标签:ons turn round config field asc value 提交 err
1.在表单上使用onSubmit方法
<?php $form = ActiveForm::begin([ ‘options‘=>[ ‘class‘ => ‘form-horizontal‘, ‘enctype‘ => ‘multipart/form-data‘, ‘onSubmit‘=>‘return validateForm(event)‘, ], ‘fieldConfig‘ => [ ‘template‘ => ‘{input}{error}‘, ‘options‘ => [‘class‘ => ‘form-field‘], ], ]); ?>
注意:onSubmit方法是写在form元素上;而不是button元素上
2.编辑触发的方法
function validateForm(event){ if($(‘.hidden_common_producer_grade_info_id[value=""]‘).length > 0){ return false; }else{ return true; } }
注意:return false则阻止表单提交
标签:ons turn round config field asc value 提交 err
原文地址:https://www.cnblogs.com/liuzhiqaingxyz/p/9042796.html