RE: TIL: That HTML forms can now ensure required fields are filled without using Javascript

You are viewing a single comment's thread from:

TIL: That HTML forms can now ensure required fields are filled without using Javascript

in til •  8 years ago 

I'm sure you already know that the required is part of HTML 5. But did you know that by using the new input types, you can also have some validation provided automatically? For example, type="email" will produce a complaint if the user doesn't enter a valid email address. The HTML would be:

<input type="email" name="email" placeholder="[email protected]">

And if you don't enter a proper address, you get an indicator similar to the one you showed that asks the user to enter a valid email address.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!