[html-formfu] EMail message text

Carl Franks fireartist at gmail.com
Tue Sep 16 10:59:32 BST 2008


2008/9/16 goetz <devel at helektra.de>:
> Hi,
>
> I'm working on some basics.
> I only want to add a individual message when the
> email is invalid.
>
> What wrong with:
>
>   - type: Text
>     name: email
>     label: email
>     constraints:
>        - Email
>            message: keine g&uuml;litige E-Mail Adresse!

Each constraint definition must be *either* a string containing the
constraint type *or* a hashref.
You've mixed up both.
That should be...

  - type: Text
    name: email
    label: email
    constraints:
      - type: Email
        message: 'keine g&uuml;litige E-Mail Adresse!'

Also note that your message will be xml-escaped.
If you're escaping it yourself, you should really be using message_xml()

Cheers,
Carl



More information about the HTML-FormFu mailing list