Home > Blockchain >  What input type is used for an input that accept email or username?
What input type is used for an input that accept email or username?

Time:11-29

I'm trying to build a login form, and one of the fields accepts both email and text(username). What type should I use for my input?

CodePudding user response:

like the guy said above you could just use normal input tags and you would have to tell the language you use for backend that the user can either put an username or a email to login the website it should look something like this:

<!DOCTYPE HTML>
<html>
<body>
<input type="text" name=mailuid placeholder="Username/email">
</body>
<html>

CodePudding user response:

your question has already been answered above. but here I want to add if you want to make an input tag for a specific email, you can also provide a pattern in the tag. like this:

<!DOCTYPE HTML>
<html>
<body>
<input type="text" id="email" placeholder="Email using @example.com" pattern=". @example\.com" required>
</body>
<html>

I hope this helps as another reference

  • Related