Examples of format are the following.
name == eMyNamef (title =~ /R/) and (title.size > 10) not (count < 20)
Format for rules is gattribute operator valueh (Attribute is accessor method or instance variable defined in component class). You can join rules with and
/or
, use not
to deny rules. If you use the operators, enclose rules with parenthesis.
Last rule In the above example, set value as number. Form data is setted as string for the valule, but the data is converted temporarily when validating. For example, the following validates input as number whether greater than or equal to 100 and less than equal to 500.
Number : CKTextField { value = number validate = g(number >= 100) and (number <= 500)g pass = pass_number }
Operators can be included in rules are the following.
Operator | Description |
---|---|
== |
Both sides are equal. |
!= |
Both sides are not equal. |
> |
Left is greater than right. |
< |
Left is less then right. |
>= |
Left is greater than or equal to right. |
<= |
Left is less than or equal to right. |
=~ |
Pattern matching. |