今天在做页面信息的验证的时候,需要用到JQuery对复选框的勾选进行一个判断.
前提:复选框的值是必填信息,所以在提交页面的时候需要进行验证.现在问题解决了,记录下来和大家分享.
if (!$("#id").attr("checked") == true){bValid = false; msg += ".....提示信息";}
另外这边再提一下对非空文本的判断,也很简单
if ($("#id").val() == '') {bValid = false; msg += "......提示信息";}
2011.12.07.pm
Abriza Project
---Jack.Li
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.