password

Description

Wpart responsible for handling password fields. In case of entering the bad input, the previous one is not restored (so the user has to enter it once again, even if it was correct).

Caution: data entered in the password field is sent unencrypted over the network, so it is strongly recommended to use an encrypted connection (https) in order to prevent the leak of the data.

The rendered widget is either

<input type="password" ... />

(in case we do not want user to confirm the entered password) or

<input type="password" ... /><br/><input type="password" ... />

otherwise.

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}

confirm

true | false

Forces user to retype his password.

{passwords_do_not_match, Inputs}

HTML meta-attributes

name

format

description

confirm

true | false

Generates two, instead of one, input fields for entering password (with the same name)

Examples

Records definitions

...
{password, [{min_length, 6},
            {max_length, 128},
            {regexp, "^[a-zA-Z][a-zA-Z_0-9]+$"}
            {confirm, true}
            %% other parameters
           ]
},
...

HTML tag

<wpart:password confirm="true" OTHER_HTML_ATTRIBUTES />

Wparts/BasicTypes/password (last edited 2009-03-24 11:21:23 by Michal Ptaszek)