Yii Framework Forum: Validatte CMultiFileUbdate - Yii Framework Forum

Jump to content

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

Validatte CMultiFileUbdate

#1 User is offline   Bogucki 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 31-July 17

Posted 16 September 2017 - 07:36 AM

Hi

How to connect CMultiFileUpload and validate-engine?


Example:
<?php $this->widget('CMultiFileUpload',  array(
	'attribute' => 'path',
	'name' => 'path',
	'model'=> $model,
	'htmlOptions' => array('data-validation-engine' => 'validate[required, funcCall[check_photo[]]]'),
...
)); ?>

<script>
$(...).validationEngine();

function check_photo(field, rules, i, options) {
	if($('.MultiFile-label').length == 0) {
		return 'Not select photos/images';
	}
}
</script>

not wrong.
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