I have been using the a javascript from
http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
for awhile and I totally like it. It’s very easy to use in order to validate the web form. What’s more, it is very easy to extend.
Here is how to extend the script so that it can find out if a user input the right confirm email address or not.
Code:
| function confirmEmail () |
| { |
| var frm = document.forms["custForm"]; |
| if(frm.email.value != frm.confirm_email.value) |
| { |
| sfm_show_error_msg("Confirm email does not match "); |
| return false; |
| } |
| else |
| { |
| return true; |
| } |
| } |
| |
| frmvalidator.setAddnlValidationFunction("confirmEmail"); |