If you enter an invalid Email address, or a value for Age outside the specified range, a .When all fields have been validated the form will be able to be submitted.This script forces the user to double check whether a valid email is entered before submitting the form.It alerts a box with the entered address upon form submission, and asks the user whether this information is correct or not before allowing the submission to continue.This example uses the Java Script XMLHttp Request object and PHP server-side scripting to check that the Email address entered is valid (at least that it matches a particular regular expression) and that the Age lies between 16 and 100.
(16 printed pages) Introduction Getting Started Writing the Validation Script Connecting the Form to the Script Associating Form Fields with Custom Script Code Listing Conclusion When you create forms, providing form validation is useful to ensure that your customers enter valid and complete data.
Advanced Email Check A script that closely examines the content of a form box to ensure that the user entered a valid email address.
If not, the form submition is canceled, and the surfer prompted to re-enter a valid address. Advanced Email Check plus screening out of certain types of addresses A script that closely examines the content of a form box to ensure that the user entered a valid email address.
If it is, the script continues and checks whether the address is of a certain type (such as hotmail and yahoo), and if it is, blocks the form submition as well.
In essense, this script allows you to not only block invalid email addresses, but "casual" addresses as well.