Any field with a name ending with a * is mandatory with Irma. This means
that it must be filled in by the user in order for the form to be
accepted.
For example, to make sure the user fills in the email field on the quickstart form,
change the field name email
to email *
:
Your email: <input type="text" name="email *">
|
Mandating fields requires some error processing on the template.
This can be achieved with the errors
variable, which will
contain the names of all missing fields.
<!--SCRIPT--
£errors~[
Please fill-in the following fields:
$errors
]^[
Hello $name!
Today, $date, your email address $email,
has been added to the mailing list.
]
-->
|
The above example uses Irma expressions. An expression is typically
[$/£]variable~[if]^[else]#[then]
. Expressions
are fully documented in this manual.
You can run, download and view the source of a demo performing actions similar to those described in this section from
http://irma.vestris.com/docs/demos/demo1-form.html
and
http://irma.vestris.com/docs/demos/demo1-template.html
.