I believe you can only include one default error message using the
form helper. It is not possible to include more than one. Which would
be the reason the 'unique' message is not showing as it is simply
ignored.

Please see below to get your validation errors working

In your model:

var $validate = array(
  'username' => array(
    'between' => array(
      'rule' => array('between', 4, 10),
      'message' => 'username must be between 4 and 10',
      'last' => true,
      'required' => true
    ),
    'unique' => array(
      'rule' => 'isUnique',
      'message' => 'username already exists'
    )
  )
);

In your view:

<?php echo $form->input('username'); ?>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to