Here my scenario is if the check box is uncheck then the corresponding fields will be disabled then for the disabled fields the client validation should not perform here for example if i uncheck the checkbox of (has a father) then the fields related to that check box like father first name, last name... so for these fields client validation should not perform . If i again check that checkbox then the client validation should perform
Here my problem is when i am uncheck the checkbox also the client side validation is happening and the form is not submiting can any one help me in this scenario. Here is my sample code
<?php echo $form->checkBox($modelFamilyFather, '[1]type', array('id'=>'type', 'checked'=>'checked','onChange' => "
if(this.value==checked)
{
$('#" . CHtml::activeId($modelFamilyFather, '[1]firstname') .
"').removeAttr('disabled','disabled');
$('#" . CHtml::activeId($modelFamilyFather,
'[1]lastName') . "').removeAttr('disabled','disabled');
$('#" . CHtml::activeId($modelFamilyFather, '[1]occupation') .
"').removeAttr('disabled','disabled');
$('#" . CHtml::activeId($modelFamilyFather, '[1]averageMonthlyIncome') .
"').removeAttr('disabled','disabled');
}
else {
$('#" . CHtml::activeId($modelFamilyFather, '[1]firstname') .
"').attr('disabled','disabled');
$('#" . CHtml::activeId($modelFamilyFather,
'[1]lastName') . "').attr('disabled','disabled');
$('#" . CHtml::activeId($modelFamilyFather, '[1]occupation') .
"').attr('disabled','disabled');
$('#" . CHtml::activeId($modelFamilyFather, '[1]averageMonthlyIncome') .
"').attr('disabled','disabled');
}
"))." <label for='Father'>Has a Father</label>";
?>