以前记得有这么一个写法,就是当表单中的内容不符合验证规则时,会不允许提交,时间一长忘了怎么写了,手册里面也没写,查了一下资料,做一下笔记 :
$form = $this->beginwidget('cactiveform',array( 'id' => 'add_host', 'enableajaxvalidation' => false, 'enableclientvalidation' => true, 'clientoptions' => array( 'validateonsubmit' => true //在这个位置做验证 ), 'focus' => array($model,'ip') )); ?>
本文标题:yii表单验证中,提交前验证,不通过不提交
本文链接:http://www.maben.com.cn/archives/593.html转载请注明出处
