验证:
<input name="userAccount" class="easyui-validatebox" data-options="required:true,validType:'length[4,20]',missingMessage: '请输入用户名',invalidMessage:'请输入4-20位字符'" maxlength="20" /> <input type="password" name="userPwd" class="easyui-validatebox" data-options="required:true,validType:'length[6,12]',missingMessage: '请输入密码',invalidMessage:'请输入6-12位字符'" maxlength="12" /> <input name="userRealName" class="easyui-validatebox" data-options="required:true,validType:'length[2,6]',missingMessage: '请输入真实姓名',invalidMessage:'请输入2-6位字符'" maxlength="6" /> <input name="userPhone" class="easyui-validatebox" data-options="validType:'length[0,20]',invalidMessage:'最多输入20位字符'" maxlength="20" />
var f = pAdd.find('form'); //对其进行验证 var check = f.form('enableValidation').form('validate'); if (!check) { $('#j_message').html("温馨提示:请将信息输入完整"); return; } else { $('#j_message').html(""); }