Content-type: text/html Validate Tag

Home
WebGroove is no longer supported. These docs are reference only.


Validate Tag
Validates CGI fields passed into an Agent script. Each line within the validate tag relates to a single field. If validation fails, an appropriate error message will be stored in the system variable {sys:errtext}, and control is transferred to the appropriate error spot, if any.

Examples
<validate error=badinfo>
name,Name
email,Email,/[w.-]+@[w-]+.[w-]+/
phone,Phone Number,/[0-9]{3}-[0-9]{3}-[0-9]{4}/,noreq
</validate>


Syntax
This is always a tag pair surrounding one or more field validations. Each line is in this format:

field name,display label,/regular expression/,noreq

Only the field name is required. The noreq bareword is only used if you want to match a non-required field against a regular expression.

Attributes
errorSpot to skip to if validation fails. This defaults to the system errspot.
successSpot to skip to if validation succeeds. By default, processing will continue right after the validate tag.


Notes
You can specify an error or success spot with most Agent tags, even if they don't appear in the attribute list. They are only shown here because it is more common to use them on this tag.

See Also
Clear Tag
If Tag
Set Tag
Store Tag

Up To
Agent Tags
Complete Tag Reference


WebGroove® is a registered trademark of Creativision Publishing Corporation