Validating a number
When building web applications, it is important you take security seriously, especially when it has to do with collecting data from users.
It is a common maxim in security to trust nobody, hence never trust the user to enter correct or valid form values.
But that is changing or rather has changed because validation can now be done using HTML5 without having to write complex Java Script validation code.
In most cases, however, you should be able to use Google to search for the regular expression you want, or even use a tool to help you.
This is a Boolean attribute used to indicate that a given input field’s value is required in order to submit the form.
Let’s examine these new form attributes to see how they can aid form validation.
This form attribute indicates what kind of input control to display such as the popular validates the field to ensure the entered data is in fact a valid email address.