Client validation works perfectly in a textfield for form, but if i change the textfield to an autocomplete it validates even if all rules are matched.
Below is my view form
<div class="form">
<?php $form=$this->beginWidget('CActiveForm',
array(
'id'=>'attendance-form',
'enableClientValidation'=>true,
'clientOptions'=>array('validateOnSubmit'=>true,'validateOnChange'=>true)
)); ?>
<?php echo $form->errorSummary($model_one); ?>
<div class="row">
<?php echo $form->labelEx($model_one,'employee_full_name'); ?>
<?php $this->widget('CAutoComplete',
array(
//name of the html field that will be generated
'model'=>$model_one,
'attribute'=>'employee_full_name',
'name'=>'employee_full_name',
'url'=>array('attendance/autoCompleteLookup'),
'max'=>10, //specifies the max number of items to display
'minChars'=>2,//specifies the number of chars that must be entered before autocomplete initiates a lookup
'delay'=>100, //number of milliseconds before lookup occurs
'matchCase'=>false, //match case when performing a lookup?
//any additional html attributes that go inside of the input field can be defined here
'htmlOptions'=>array('size'=>'40'),
'methodChain'=>".result(function(event,item){\$(\"#user_id\").val(item[1]);})",
));
echo CHtml::hiddenField('user_id');
?>
<?php echo $form->error($model_one,'employee_full_name'); ?>
</div>
<div class="row submit">
<?php echo CHtml::submitButton('Get Employee Data'); ?>
</div>
<?php $this->endWidget(); ?>