CCK validation

Events happening in the community are now at Drupal community events on www.drupal.org.
Web_Spider's picture

Validating form input using Rules

Hi!

I'm trying to setup Rules to validate my form input for me, when using CCK fields.

So far I've made 1 form, with one CCK text field, called field_email.

I've tried various ways to get Rules to check if this is a valid email address or not, by using Triggered rules:

ON event My node form is being validated
IF
NOT
condition Execute custom PHP code

DO
action Set form error on element 'field_email[0]'

The custom PHP code is simple:

return valid_email_address($form_state['values']['field_email'][0]['value']);

Read more
Subscribe with RSS Syndicate content