HTML Required Fields

by NathanS24 in Circuits > Websites

1425 Views, 8 Favorites, 0 Comments

HTML Required Fields

html5-required-indication.jpg

If you want to make your form fields required so that the browsers stops a user from submitting empty fields, then the "required" attribute is for you. It is supported on most modern browsers and full support information can be found at http://caniuse.com/#feat=form-validation

Locate Your HTML Form

HTMLFORM.PNG

Find the file with the HTML form you want to edit and open it in your favorite text editor.

Add the "required" Attribute

HTMLFORM_REQUIRED.PNG

Add the "required" attribute to each field that you want to be required.

Refresh Your Page and Test

And you are done! Remember to make sure that the browsers your users have supports this by checking the compatibility at http://caniuse.com/#feat=form-validation