I'm trying to use Dardo Sordi MultivalidatableBehavior (http://
bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-
validation-rulesets-per-model).
I have a Model with different rules depending on the value of a field
(a select box).
The select box is monitored by ajax->observeField and when the select
changes other fields are shown or hidden. In the controller there's a
function where I put the code to change the validation rules:
function update_div() {
if(!empty($this->data)) {
Configure::write('debug', 0);
if ($options!='')
{
$this->log('val ferrovie1');
$this->log($this->Cycleway->validate);
$this->Cycleway->setValidation('ferrovie');
$this->log('val ferrovie2');
$this->log($this->Cycleway->validate);
}
else
$this->Cycleway->restoreDefaultValidation();
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---