
beginWidget(‘CActiveForm’, array(
‘id’ => ‘question_order-_form-form’,
‘enableAjaxValidation’ => true,
‘enableClientValidation’ => true,
‘clientOptions’ => array(
‘validateOnSubmit’ => true,
‘afterValidate’ => ‘js:submit_checkout’,
),
‘htmlOptions’ => array(
‘autocomplete’ => ‘off’
)
)); ?>
js函数的实际规则为:
if (hasError == false) {
return false;
} else {
return true; // 返回true的话就会继续执行表单提交操作!
}
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/webdev/175149.html