Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

How To Exclude File Input Fields In Ajax Validation

$
0
0
I have created the ajax validation and it performs well for each field except the file input field. It keeps alerting me in red. I want to ask if there are any way to exclude file input fields in ajax validation?

Here is my rule:
public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('id_product, id_color, store, try_store', 'required'),
			array('id_product, id_color, store, try_store', 'numerical', 'integerOnly'=>true),
			array('path_one, path_two, path_three, path_four', 'length', 'max'=>200,'on'=>'insert,update'),
			array('path_one, path_two, path_three, path_four', 'file','types'=>'jpeg,jpg,png,gif','allowEmpty'=>false,'on'=>'insert'),
			array('path_one, path_two, path_three, path_four', 'file','types'=>'jpeg,jpg,png,gif','allowEmpty'=>true,'on'=>'update'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, path_one, path_two, path_three, path_four, id_product, id_color, store, try_store', 'safe', 'on'=>'search'),
		);
	}

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>