Wednesday, March 25, 2009

Re: data validation problem with multiple parameters

> Just a guess, but are you passing the auto-generated password to the
> view when validation fails, so that it can be used in your form's
> action attribute when re-POSTing another attempt at a new password?

I don't think so. I am not doing anything. I am new to cakePHP. How
do I do that? here is the section of my resetPassword method that is
used:

if(!empty($this->data))
{
$this->Person->set($this->data);
if($this->Person->validates())
{
$this->Person->saveField('has_reset_password', '1');
$this->Person->saveField('password', $this->data
['Person']['password']);
$this->Session->setFlash(__('Password has been saved',
true));
$this->redirect(array('action'=>'index'));
}
}

As you can see, if the data isnt valid, it drops out of this section
of code, and in fact, out of the method. When this happens, the page
redisplays which fields are invalid but the address no longer contains
the password. I am guessing this is some auto feature of cakePHP.
How do I make sure my view gets both parameters after validating the
data?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: