Early detection of abnormalities in the form data is extremely important: it reduces server load by avoiding data that would be otherwise processed and then rejected) and protects your website’s available bandwidth (users’ data would only travel to the server if it is certain that they have the correct format).
Let it be emphasized that only you can be confident in the data syntax, not its semantics. A user can enter a syntactically correct email address yet not a valid one.
Field Validator is a powerful tool in this regard: it is absolutely essential when developing a website that requires forms. Field Validator verifies the data entered in a given form and prevents transmission to the web server if data don't comply with the validation rules defined, while additionally signaling the form fields that generated the problem.
Comes with a set of popular validation rules.
Validation rules are independent for each field.
Fields can be validated even if they don’t belong to a form.
Fields that do not meet the validation rules are marked (allowing the end user to know which of the fields contains incorrect info)
If at least one field in a form fails to be validated, the form will not be sent to the server for processing.
Validation rules available for use in the Field Validator:
Required: with this rule, the field cannot be left empty.
Numerical: field value should be a number.
Number positive: the field value must be a number greater than zero.
Integer: the value of field must be a number that has no fractions.
Only letters: digits are not allowed.
eMail: field value should be an email address, syntactically correct.
(U.S.) Zip Code: Only numbers are allowed, matching the form of the US postal code (5 digits).
Credit Card: a valid value will comply with the syntactic principles of a credit card number.
Confirmation: this rule allows to compare values of two fields and fails if both values are different. In forms to create a user account, this validation rule is needed to confirm the password or email address of the user.
Number of characters: through this rule we can limit the amount of characters that can be inserted into a field, either by default or by excess.
Value range: Similar to the previous rule, except in this case the value you enter can not exceed the limit imposed, either by default or by excess.
Is selected: this validation rule, used by checkboxes and radio buttons, fails if left unmarked. This validation rule also allows to validate a set of checkbox and radio buttons, to see if all of them are marked or if at least one of them is.
Regular expression: if the rest of the validation rules are not sufficeint and you want the data satisfy a more specific format, you can define a regular expression for validation.
This product was originally published by HotDreamweaver. DWBooster.com is an authorized reseller of HotDreamweaver' products. Your purchase is automatically registered with HotDreamweaver, and so is your personal code for technical support services.