First, a big "Thank You" to this group, it's helped me a lot by
reading posts here.
I'm using ajax to pre-validate a form while the user types data into
the form's fields. So, if the user types a username that is too
short, or already in use, etc., they are notified by the script as
they type. You know the drill. ;)
I'm using cakePHP's model validation to test if the data is valid. If
I include only one field in the $validate array, for exaple:
'username', and then I put the following logic in my controller:
$this->MyModel->set($this->data);
if ($this->MyModel->validates()) {
$this->render('validate', 'ajax');
else {
$this->render('invalidate', 'ajax');
}
everything works fine. However, if I include muliple fields in the
model's $validate array, like password, email, etc., then when I try
to validate only the username (the user has not typed anything into
the password or email field yet), it does not validate (presumably
because the logic I have written for validating a password states that
the password field cannot be empty), and the code renders the
invalidate.ctp.
I'm seperating the controller actions into username_validate,
password_validate, etc. for the ajax calls, so how do I get cakephp to
only check if the username is valid, when password and email data is
not present?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---