string
Description
Wpart responsible for dealing with the one line length text.
The rendered widget is <input type="text" ... />.
Validation
option |
format |
description |
error message |
min_length |
Min :: integer() |
Specifies the minimal length of the string. |
{too_short, Input} |
max_length |
Max :: integer() |
Specifies the maximal length of the string. |
{too_long, Input} |
regexp |
"Regexp" |
Describes the pattern password should match. The format is the same as used in re module (http://www.erlang.org/doc/man/re.html) |
{regexp_does_not_match, Input} |
html_whitelist |
["Tag1", "Tag2", ...] |
Defines the whitelist XHTML tags. If the option is not provided, the XHTML validation will be not triggered. |
{{not_valid_html, Reason}, Input} |
HTML validation reasons
error type |
description |
{no_closing_tag, Tag} |
The opened tag has not been closed |
{closing_bad_tag, Opened, Closed} |
The tag has been closed is not the same as the opened recently |
open_tag_inside_tag |
Next tag is opened inside of the other tag body |
{no_open_quote, Tag} |
One of the attribute value is not quoted |
{tag_not_in_whitelist, Tag} |
The tag is blacklisted |
{tags_not_closed, Tags} |
Some tags has not been closed but parser end its job |
HTML meta-attributes
name |
format |
description |
Examples
Records definitions
...
{string, [{max_length, 100},
{regexp, "^[A-Z0-9]"},
{html_whitelist, ["b", "br", "i"]}
%% other parameters
]
},
...
HTML tag
<wpart:string OTHER_HTML_ATTRIBUTES />
