Hi Nate,

The mailer extension supports very simple validation. It enforces mandatory fields, and ensures the "from" and "recipients" fields exists and have an @ in the email address. The from and recipients enforcement comes right out of the box. Nothing to do to get that working.


To make a mandatory field, you add a required attribute

<r:mailer:textarea name="message" required="true" />

When that field fails validation (no content is provided) you can get at the error messages with the mailer errors tags.

  <r:mailer:error on="message" >
    <p>Message <r:mailer:error:message /></p>
  </r:mailer:error>

the error message is "is required".

The error messages the from and recipients fields are stored against the "form". To access those...

  <r:mailer:error on="form" >
    <p><r:mailer:error:message /></p>
  </r:mailer:error>

Hope that helps.

Thanks,

::: hamish rickerby :::
m: [EMAIL PROTECTED]

http://glimmerdesign.com



On 15 Nov 2008, at 16:25, Nate Turnage wrote:

I am using the mailer extension for the first time and was wondering if there is any kind of form validation built into the extension. I looked at the code and I cannot find anything. Did I miss something? How are other
people doing form validation with mailer?



Thanks,

Nate
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to