<tr><td>备注:</td><td colspan="3"> <input type="text" style="width:80%" class="txt03" id="txtRemark"></textarea></td></tr>
<tr><td> </td><td colspan="3"><input id="Checkbox1" type="checkbox" /><label>超级管理员</label> <input id="Checkbox2" type="checkbox" /><label>禁用</label></td></tr>
</table>
这一段JS 是必不可少的
$(function(){
$('#uiform input').each(function () {
if ($(this).attr('required') || $(this).attr('validType'))
$(this).validatebox();
})
});这样就ok了
如果在提交时验证表单有没有通过验证,则可使用下面的代码
var flag = true;$('#uiform input').each(function () {
if ($(this).attr('required') || $(this).attr('validType')) {
if (!$(this).validatebox('isValid')) {
flag = false;
return;
}
}
})
if (flag)
alert('验证通过!');
else
alert('验证失败!');










