Hello
I'm setting up a user registration form with a 'password_new' and
'password_confirm' fields.
These fields are not in my database (and not official fields in my
User model).
Can I validate these fields using the validation rules in my User
model? (I was under the impression from some other posts that this was
possible).
Here are the form calls in my view (register.ctp):
<?php echo $form->password('password_new', array('label' => false)); ?
>
<?php echo $form->password('password_confirm', array('label' =>
false)); ?>
The authentication is set up like so in my User model:
var $validate = array(
'password_new' => array(
'rule' => VALID_NOT_EMPTY,
'required' => true,
'allowEmpty' => false,
'message' => 'Passwords need to be a mimimum 8
characters long'
),
'password_confirm' => array(
'rule' => VALID_NOT_EMPTY,
'required' => true,
'allowEmpty' => false,
'message' => 'Passwords need to be a mimimum 8
characters long'
),
)
Yet, if I submit a form with both of these fields blank, no error
message is generated.
I also need to compare the values of these fields. Is there a way to
do this in the controller or can it also be done through the model
validation?
Thanks,
August
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---