Daeva
In Runtime
- Messages
- 407
Sorry, I probably should have clarified more.
That script (when the user clicks the submit button), runs through all of the input elements in the form.
It looks for specific input elements (text,textarea,etc...). If it finds one of these, it checks the name of the element (indicating which type of validation should be performed on it, whether it is required, or needs a regular expression validation, or two fields need to match, etc...) and performs the validation.
If the validation passes, it does nothing.
Initially a boolean value indicating whether the form is valid or not is set to true. The ONLY time this value is changed is if one of the validations fails. Upon a failure, it makes a note of which field failed and why, then displays a summary to the user explaining why it failed. On the textarea, it also track the number of characters remaining in the field.
Both the phone number and e-mail address are validated to ensure that bogus information is not entered into the field, thus improving the integrity of the data sent to the end-user.
Let me know if you have any other questions.
That script (when the user clicks the submit button), runs through all of the input elements in the form.
It looks for specific input elements (text,textarea,etc...). If it finds one of these, it checks the name of the element (indicating which type of validation should be performed on it, whether it is required, or needs a regular expression validation, or two fields need to match, etc...) and performs the validation.
If the validation passes, it does nothing.
Initially a boolean value indicating whether the form is valid or not is set to true. The ONLY time this value is changed is if one of the validations fails. Upon a failure, it makes a note of which field failed and why, then displays a summary to the user explaining why it failed. On the textarea, it also track the number of characters remaining in the field.
Both the phone number and e-mail address are validated to ensure that bogus information is not entered into the field, thus improving the integrity of the data sent to the end-user.
Let me know if you have any other questions.