If correct, the application allows the data to be submitted to the server and (usually) saved in a database; if not, it gives you an error message explaining what corrections need to be made.
Form validation can be implemented in a number of different ways.
This is done by using validation attributes on form elements, which allow you to specify rules for a form input like whether a value needs to be filled in, the minimum and maximum length of the data, whether it needs to be a number, an email address, or something else, and a pattern that it must match.
attribute to turn off the browser's automatic validation; this lets our script take control over validation.
a-z, A-Z or 0-9) we use a regular expression /^[0-9a-z A-Z] $/ which allows only letters and numbers.