3
<?php
echo $form->dropDownList($model,'ment_id', $mentslists,
array(
'prompt'=>'Select ment',
'class'=>'required'
));
echo $form->error($model,'ment_id');
?>
Onchange dropdownlist我想爲CMultiFileUpload設置最大值。Onchange下拉列表動態設置最大值yii CMultiFileUpload
我CMultiFileUpload代碼,
<?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'),
));
?>
我試圖平變化從下拉列表數據庫,如何將值應用到最大領域獲得最大的允許大小值。
我jQuery代碼是,
$("#ment_id").on('change',function()
{
$.ajax({
type: "POST",
url: "/ments/default/GetmentDetails",
data: {'ment_id':$(this).val()},
success: function(data){
//data having the max upload value
}
});
});
我的控制器代碼,
public function actionGetmentDetails()
{
$id = $_POST['ment_id'];
$assign_details = Ments::model()->findAllByAttributes(array('id'=>$id));
echo $assign_details[0]['c_max_upload_files'];
exit;
}
如何設置動態地根據不斷變化的下拉列表中最大值,
你有一個網站,這是運行在看看? – Demodave 2014-11-06 18:40:46