Required field validator not validating

After the user enters data into a Web form, clicks the Submit button, and sends the form data to the server as a request, you can perform server-side validation on the data.If the data is incorrect or not valid, you can send back a response stating this.One of the most common elements of Web pages is a form in which the user can input data that is posted back to the server.

required field validator not validating-25required field validator not validating-13

Java Script is a great language, but takes a lot of time to master, and there are always problems getting your Java Script code to work on different browsers.

Listing 1 shows you an example of using client-side Java Script to perform form validation.

If, however, when the user clicks the Submit button, a scripting language that is part of the overall HTML page is initiated to check the validity of the data before it is sent to the server, this is client-side validation.

It was a lot easier to understand the difference between these forms of validation when you coded Active Server Pages 3.0 because, as the programmer, you personally performed almost all data validation.

The other option for form validation is to put some client-side Java Script or VBScript at the top of the ASP page that checks if the information in the fields is correct.

This takes care of the problem of making unnecessary trips to the server, but it requires another language to learn and manage.Obviously, this may cause people to leave your site for another.The bad thing about server-side validation is that it requires trips back and forth to the server.Sometimes, you carried the correct input from the other fields back to the form page, and populated the fields for the users so they didn't have to re-enter the same information again.Some sites on the Internet don't carry this inputted information back to the form page, and the user is then required to enter all the information into the form a second time.You can check for many types of information, as you learn in the rest of this article.

Tags: , ,