validator_base_email (zotonic_mod_base v1.0.0-rc.17)

Check if the content of the input field is an e-mail address.

For example:

<input type="text" id="email" name="email" value="" />
{% validate id="email" type={email} %}

Arguments

ArgumentDescriptionExample
failure\_messageMessage to show when the entered value is not an e-mail address. Defaults to “Incorrect E-mail”failure_message="Please enter your e-mail address."

See also

Forms and validation

Summary

Functions

render_validator/5

validate/5

-spec validate(term(), term(), term(), list(), z:context()) ->
                  {{ok, term()}, z:context()} | {{error, term(), term()}, z:context()}.