我有以下字段只提出Ajax Valiadtion
<?=
$form->field($questionModel,
'questions_options_order')->dropDownList(Yii::$app->controller->optionsOrderArr
, ['class' => 'form-control required'])
?>
答案 0 :(得分:0)
模型冲动
public function rules()
{
return [
[['questions_options_order'], 'required'],
];
}
查看看起来像这样
<?=
$form->field($questionModel,
'questions_options_order')->dropDownList(Yii::$app->controller->optionsOrderArr
, ['prompt' => 'Select options Type'])
?>
答案 1 :(得分:0)
> Put Enable Ajaxvalidation true specific filed
<?=
$form->field($oModel, 'variable_file',['enableAjaxValidation' => false])->widget(FileInput::classname(), [
'options' => ['accept' => 'csv', 'class' => 'required file_input'],
'pluginOptions' => ['allowedFileExtensions' => ['csv']]
]);
?>