If a user enters a non-integer value, the error is reported as soon as the user leaves the entry field.
Users get immediate feedback, which is convenient for them.
When you restrict the values that users can enter in forms, you reduce the chance that someone can enter a value that can compromise the security of your site.
To see how validation works, run this page and deliberately make mistakes.
Therefore, you also have to make sure that the values that users enter can be correctly converted to the appropriate data types.
You might also have certain restrictions on the values.
In that case, the validation is performed as users work in the browser.
For example, you don't want to process a form that's missing critical information.
However, the test will be performed in server code.
You can control how validation errors are displayed by defining CSS classes that have the following reserved names: .
When users enter values into an HTML form, the values that they enter are strings.
In many cases, the values you need are some other data types, like integers or dates.
The second Text Box is Email that only allows email format.