<?php
echo $form->dropDownList($model,‘ment_id’, $mentslists,
array(
'prompt'=>'Select ment',
'class'=>'required'
));
echo $form->error($model,'ment_id');
?>
Onchange dropdownlist i want to set max value for the CMultiFileUpload.
my CMultiFileUpload code is ,
<?php
$this->widget(‘CMultiFileUpload’, array(
'name' => 'data1',
'attribute' => 'image',
'accept' => 'doc|docx|pdf|txt|jpeg|jpg|png',
'max' => 10,
'duplicate' => 'file appears twice',
'remove' => Yii::t('ui', 'Remove'),
));
?>
i tried onchange dropdown get max allowed size value from database , how to apply the value to max field.
my jquery code is ,
$("#ment_id").on(‘change’,function()
{
$.ajax({
type: "POST",
url: "/assig/default/GetAssignDetails",
data: {'a_id':$(this).val()},
success: function(data){
//data having the max upload value
}
});
});
my controller code is ,
public function actionGetAssignDetails()
{
$id = $_POST['a_id'];
$assign_details = Assig::model()->findAllByAttributes(array('id'=>$id));
echo $assign_details[0]['c_max_upload_files'];
exit;
}
how to set the max value dynamically based on changing dropdown list ,