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.
Sometimes you have to validate information that doesn't come directly from an HTML form.
A typical example is a page where a value is passed in a query string, as in the following example: source, including form-field values, query-string values, and cookie values.
For example, if a page has an element as a placeholder for an individual field error, even if there is no error.
In some situations, displaying an error message can cause the page to reflow and can cause elements on the page to move around.
It's important to understand that the markup for the error display is always rendered, even if there are no errors.
The CSS rules that end in to both have the same fixed size.
That way, the display area for the field is static and won't change the page flow if an error message is displayed.
Even if users correctly enter an integer, for example, you might need to make sure that the value falls within a certain range.
Note Important Validating user input is also important for security.