Pjax::begin();
$form = ActiveForm::begin();
echo $form->field($model, 'testdata', [
'inputOptions' => [
'class' => 'form-control input-xsmall input-inline' ],
])->label(Yii::t('app', 'Records : '))
->dropDownList(['10'=> 10, '15' => 15, '20' => 20, '50' => 50], ['onchange'=>"this.form.submit();"]);
ActiveForm::end();
Pjax::end();
上面的表格允许我在变更事件上提交表格 如何让表单提交onload?
答案 0 :(得分:0)
您可以使用onloadFunctions
,如下所示。您需要在控制器中定义属性。 Source
<body onload="<?php echo Yii::app()->controller->onloadFunction; ?">
控制器:
class MyController extends Controller
{
public $onloadFunction='AJavascriptFunction();';
}