Validating custom control
If your web browser supports HTML5, it will not allow you to submit the form without entering text into the input field.
Instead, it will display a message that is generated by the web browser itself.
In some situations, such as validating custom controls or supporting legacy browsers, additional scripting may be necessary to validate user input.
Custom validation needs to notify users in an accessible way as described in the User Notifications part of this tutorial.
Client-side validation alone does not ensure security; therefore data needs to be validated on the server-side as well.
Forms frequently include required input that needs to be clearly identified using labels.
Input errors, such as an incorrect email address, will be indicated using the web browser dialogs as in the previous example.
Similarly, the “Number” input field may be displayed with buttons to increase or decrease the number incrementally.These dialogs are expected to respect the settings and preferences of the user in the web browser (and operating system), such as default font-size, colors, and language.In the example below, the attribute is added to the input field.For example, telephone numbers are written with different separators and digit groupings.Your form will be easier to use if it can interpret multiple notations. For example, postal codes aren't confined to just numbers in some countries, so using an can easily become a problem for many of your website users.