wai_input
Last updated
Last updated
Required attributes:
id unique identification of the item (unique in the whole form).
type item type: 'wai_input'.
label label displayed next to the item.
size number of letters a user can enter.
Optional attributes:
help any text that should help to understand what value is required. It is displayed on the right of the item.
must set 'Y' when the value is required, 'N' otherwise.
expr predefined expression or regular expression. Predefined expressions are here for ease of use and have special meaning. Regular expressions support standard regex patterns.
Available predefined expressions are:
expr="MEMBER=[]" requires a valid member name.
expr="DSN=[]" requires a valid DSN without a member.
expr="DSNMEMBER=[]" requires a valid DSN optionally also with a member in parentheses.
expr="CUSTOM=[]" makes no validity checks when coded like this.
As you can see there are square brackets after the keyword. A test of validity of user data has two phases:
1. it checks member and/or dsn if MEMBER, DSN or DSNMEMBER is specified .
2. it also performs checks specified in square brackets. In case of member and dsn no further check is usually needed, but it is still possible. The additional check is useful primarily for CUSTOM keyword. See this example:
expr="CUSTOM=[expr='/^[a-z]+$/',maxlength=44,maxlinelength=10]"
Here are 3 additional checks (currently the only ones supported):
expr: regular expression (in this sample it allows only small letters.
maxlength: maximal number of letters entered.
Besides predefined expressions you can use standard regular expression coded in the "old style" without CUSTOM keyword: expr='/^[a-z]+$/'
The newer style for the same check is: expr="CUSTOM=[expr='/^[a-z]+$/']"
range range of allowed integer values in format from-to. For example: range="1-99"
default the default value of the item. It is used by default unless it is explicitly set by PRX rules.
disabled set 'N' if the field can't be edited. Set 'Y' if a modification is allowed.
maxlinelength: maximal length of a line (useful for and fields only).It is possible to combine any of these additional checks, you can use one, two, all three or none.