Validating input fields speed dating walkthrough
If any fields are not valid, the form will not be submitted and the user will be informed with error messages for the fields that are causing problems.
For the sake of demonstration, we have taken five countries only. function form Validation() function userid_validation(uid,mx,my) function passid_validation(passid,mx,my) function all Letter(uname) function alphanumeric(uadd) function countryselect(ucountry) function allnumeric(uzip) function Validate Email(uemail) function validsex(umsex,ufsex) Flowchart : Download the Validation code from here.
All those functions are called from another function.
It sets the focus to the input field until the user supplies a valid value.
When the user does so, they may proceed and can supply value to the next available field.
The later Java Script function created is called on the onsubmit event of the form. If Male or Female is selected, it generates an alert saying that the form is successfully submitted and it reloads the form.
You can view this Sample Java Script Registration From Validation Example in a separate browser window and check how the validation is working.