<clear>
Resets the guard variable, event counters, and prompt counters for one or more form items or to an ECMAscript-defined default. You can also use this element to set an arbitrary ECMA variable to undefined.
Attributes
This section describes the attributes you can set for this element.
|
Name |
Data type |
Default |
|---|---|---|
|
CDATA |
optional |
namelist
The namelist attribute specifies the name of the variable to clear:
<clear namelist="variables_to_reset" />
Where:
variables_to_reset is a space-separated list of one or more variable names.
The list may include variable names other than form items. Variables named are assumed to be within the current scope; however, each variable name in the namelist may be prefixed with a scope name if necessary.
To clear guard variables, you must specify a value for the name attribute of the form item that you wish to reset. If the namelist attribute is not specified, then all form items in the current form are cleared.
If an undeclared variable appears in the list, an error.semantic is thrown.
Note: Commas are not allowed in the syntax of namelist attribute.
The following example repeatedly executes the <field> element and clears its result. This causes the interpreter to execute the field again in an endless loop.
<form>
<field name="myfield">
...
</field>
<filled>
<clear namelist="myfield"/>
</filled>
</form>
Children
- None.
Parents
Sample code
<clear namelist="city state zip"/>