用php验证:
1. 在plus/diy.php 的第 40行下加
//增加必填字段判断 if($required!=''){ if(preg_match('/,/', $required)) { $requireds = explode(',',$required); foreach($requireds as $field){ if($$field==''){ showMsg('带*号的为必填内容,请正确填写', '-1'); exit(); } } }else{ if($required==''){ showMsg('带*号的为必填内容,请正确填写', '-1'); exit(); } } } //end |
2.在模版的表单里加 :
<input type="hidden" name="required" value="name,qq" /> |