Creates a self-verifying input widget.
- fail-if-failed="name"
-
The verification of this variable will always fail if the
verification of a named variable also failed.
- ignore-if-false
-
Don't verify if the false flag i set.
- ignore-if-failed="name"
-
Don't verify if the verification of a named variable failed.
- ignore-if-gone
-
Don't verify if the variable is missing from the form scope.
This is useful if the widget might be disabled. Be careful not to
set this flag on all input fields since this would cause the form
to verify upon first request to the page.
- ignore-if-verified="name"
-
Don't verify if the verification of a named variable succeeded.
- name="string"
-
The name of the variable that should be set.
- value="anything"
-
The default value of this input widget.
- scope="name" (vinput)
-
The name of the scope that is created in this tag.
- trim
-
Trim the variable before verification.
- type="{int, float, email, date, text, string, password}"
-
Set the type of the data that should be input, and hence what
widget should be used and how the input should be verified.
- date="string"
-
If not specified toghether with the type="date" attribute the date will be
verified as an ISO-date, i.e Y-M-D. If another date format is
desired it should be specified with the date-attribute.
Examples:
date='%Y-%M-%D %h:%m' will verify a date formatted as '2040-11-08 2:46',
date='%Y w%W %e %h:%m %p %z' will verify '1913 w4 monday 2:14 pm CET'
These are the format characters:
%Y
|
absolute year
|
%y
|
dwim year (70-99 is 1970-1999, 0-69 is 2000-2069)
|
%M
|
month (number, name or short name) (needs %y)
|
%W
|
week (needs %y)
|
%D
|
date (needs %y, %m)
|
%d
|
short date (20000304, 000304)
|
%a
|
day (needs %y)
|
%e
|
weekday (needs %y, %w)
|
%h
|
hour (needs %d, %D or %W)
|
%m
|
minute (needs %h)
|
%s
|
second (needs %m)
|
%f
|
fraction of a second (needs %s)
|
%t
|
short time (205314, 2053)
|
%z
|
zone
|
%p
|
'am' or 'pm'
|
%n
|
empty string (to be put at the end of formats).
You can also use '%*[....]' to skip some characters.
|
- minlength="number"
-
Verify that the variable has at least this many characters. Only
available when using the type password, string or text.
- maxlength="number"
-
Verify that the variable has at most this many characters. Only
available when using the type password, string or text.
- is="empty"
-
Verify that the variable is empty. Pretty useless... Only available
when using the type password, string or text.
- glob="pattern"
-
Verify that the variable match a certain glob pattern. Only available
when using the type password, string or text.
- regexp="pattern"
-
Verify that the variable match a certain regexp pattern. Only
available when using the type password, string or text.
- case="{upper, lower}"
-
Verify that the variable is all uppercased (or all lowercased). Only
available when using the type password, string or text.
- equal="string"
-
Verify that the variable is equal to a given string. Pretty
useless... Only available when using the type password, string or text.
- disable-domain-check
-
Only available when using the email type. When set the email domain
will not be checked against a DNS to verify that it does exists.
- mode="{before, after, complex}"
-
Select how to treat the contents of the vinput container.
Before puts the contents before the input tag, and after
puts it after, in the event of failed verification. If complex, use one tag
<verified> for what should be outputted in the event of
successful verification tag <failed> for every other event.
<table>
<tr><td>upper</td>
<vinput name='a' case='upper' mode='complex'>
<verified><td bgcolor='green'>&_.input:none;</td></verified>
<failed><td bgcolor='red'>&_.input:none;</td></failed>
</vinput></tr>
<tr><td><input type='submit' /></td></tr>
</table> |
- min="number"
-
Check that the number is at least the given. Only available when
using the type int or float.
- max="number"
-
Check that the number is not greater than the given. Only available when using
the type int or float.
- optional
-
Indicates that the variable should only be tested if it does contain
something.