OpenWGA 7.6 - WebTML reference

WebTML tags » validate

<tml:validate cleariferror ="field-name, field-name, ...">

Purpose:

Defines a list of <tml:input> fields which values are cleared if this validation fails.

Description:

If the validation fails the given <tml:input> fields and their values are automatically cleared. This way the user is forced to reenter these fields which might be useful on complex forms where multiple fields depends on each other.

Value(s):

Comma separated list of <tml:input> fields.

Examples:

This example demonstrates a registration form where the user must enter a password twice, to ensure there are no typos in the password value. Both password fields are compared to each other. If the validation fails both fields are cleared and the user is forced to reenter the password.

<tml:form id="setpassword">

Password: <tml:input type="hashedpassword" name="pwd1"/><br/>
Reenter password: <tml:input type="hashedpassword" name="pwd2"/><br/>
<tml:button clickaction="storePassword">Store</tml:button>
<tml:validate condition="tmlform.enteredValue('pwd1') == tmlform.enteredValue('pwd2')" cleariferror="pwd1,pwd2">
The entered passwords did not match!
</tml:validate>

</tml:form>