Hi all,
I'm trying to make some changes to the data returned by a submit in
the beforeValidate() function in the file user.php which is the file
associated with the database users. I've shown an example of this
below:
function beforeValidate() {
$this->data['User']['age'] = 'abc';
return true;
}
Also, I have included a validation criteria for the age field like
this in user.php:
var $validate = array ('age' => VALID_NUMBER);
When I type in a number (say 30) in the html form, the validation
doesn't fail, eventhough the value in $this->data should be 'abc'
which is NOT a valid number. For some reason, the validation process
sees the number 30, eventhough the value saved to the database is 0
(which is the default value - since the database doesn't know what to
do with 'abc'). Why are changes made in the beforeValidate() function
not visibile to the validation portion of cake? Am i missing
something? Help is appreciated. thanks
Ram
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---