Some field types will not set the custom error message provided to #rules, example - the email type field.
So if i declare a field like this:

$form['email'] = array(
  '#type' => 'textfield',
  '#title' => t('Email'),
  '#required' => TRUE,
  '#rules' => array(
    array('rule' => 'email', 'error' => t('Invalid email address')),
  ),
);

clientside validation will not display the custom error message - 'Invalid email address'

Comments

jelle_s’s picture

Status: Active » Fixed

Fixed in the latest dev version (both 6 and 7)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.