I have created a form which allows user to save tabular data. I have followed this tutorial . I have managed to add multiple instance for a Model and I am getting the data in th
http://www.yiiframework.com/doc/api/1.1/CActiveForm
The AJAX-based validation has a few limitations. First, it does not work with file upload fields. Second, it should not be used to perform validations that may cause server-side state changes. Third, it is not designed to work with tabular data input for the moment.
So, you need to write custom error handler for tabular data
//view
$form = $this->beginWidget('CActiveForm', array(
'enableClientValidation' => true,
'clientOptions' => array(
'validateOnChange' => false,
'validateOnType' => false,
'validateOnSubmit' => true,
'beforeValidate' => 'js:formBeforeValidate',
'afterValidate' => 'js:formAfterValidate'
),
));
//some js
function formBeforeValidate (form) {
//clean errors
return true;
}
function formAfterValidate(form, data, hasError) {
if (hasError === true) {
//append errors to input
}
return !hasError;
}