I’m trying to use afterValidade of CActiveForm and it doesn’t seems to work. I made this code =>
_form.php
<?php
/* @var $this Itens_EmprestimoController */
/* @var $Itens_Emprestimo Itens_Emprestimo */
/* @var $form CActiveForm */
$js=<<<EOD
js:function(form, data, hasError) {
alert('after');
return false;
}
EOD;
$js1=<<<EOD
js:function(form) {
alert('before');
return true;
}
EOD;
?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'itens--emprestimo-form',
'enableAjaxValidation'=>true,
'clientOptions'=>array('validateOnSubmit'=>true,
'afterValidade'=>$js,
'beforeValidate'=>$js1))); ?>
...
I first trying to made an ajax request in afterValidade, but it doesn’t work then
i made this code to test afterValidade, beforeValidade works but afterValidade not.
I enable the performAjaxValidation in controller.
I use yii 1.1.12