Image Validation Clientoptions not working?

Hi,

I need Image Validation without Page refresh Input type text & select box it’s working fine, But image Validation Working after only form submit only.

My Coding ,

Enable validateOnSubmit true.

<?php $form=$this->beginWidget(‘CActiveForm’, array(

						'id'=&gt;'enquiry-form',							


                        'enableAjaxValidation'=&gt;true,


                         'clientOptions'=&gt;array(


                          'validateOnSubmit'=&gt;true,                              


                         ),


						'htmlOptions' =&gt; array('enctype' =&gt; 'multipart/form-data',


							'class'=&gt;'contact_form'


							),


					)); ?&gt;

Once Image upload wrong format need to show the validation error without page refresh how to show like?

Please Anyone tell me Is it possible or not AsAp.Because Am trying to fix this issue more than 4 hours.

Hi Geetha,

You may use this file validation to model file




['image', 'file', 'allowEmpty'=>true, 'types'=>'jpg,jpeg,gif,png']



For more detailed info you may refer the link -> http://www.yiiframework.com/doc/api/1.1/CFileValidator