Yii Framework Forum: Image Validation Clientoptions not working? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Image Validation Clientoptions not working? Image Validation Clientoptions not working? Rate Topic: -----

#1 User is offline   Geetha Janar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 05-October 17

Posted 27 October 2017 - 08:25 AM

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'=>'enquiry-form',
'enableAjaxValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
'htmlOptions' => array('enctype' => 'multipart/form-data',
'class'=>'contact_form'
),
)); ?>

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.
0

#2 User is offline   Arockia Johnson SR 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 183
  • Joined: 25-June 13
  • Location:Singapore

Posted 09 November 2017 - 04:42 AM

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.yiiframew.../CFileValidator
மகிழ்ச்சியாக குறியிடுங்கள்!..... Happy Coding!.....


Thanks & Regards,
ஜான்சன் ( Arockia Johnson SR )
www.arojohnson.tk

Hit (+) button If my replies really helped you!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users