使用javascript或jquery验证复选框 [英] Validate check box using javascript or jquery
本文介绍了使用javascript或jquery验证复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在网格内有一个复选框,我想检查单击按钮事件时是否必须选中至少一个复选框.我想使用javascript或jquery做到这一点.我正在使用剃刀视图引擎.我是
之类的复选框的Assignig ID
@ Html.CheckBoxFor(modelItem => item.CheckBox,新的{id ="assignChkBx" + @ item.ReportID})
我不知道该如何应对.
在此先感谢.
I have checkbox inside grid, I want to check that atlest one checkbox must be selected on click of button event. I want to do this with using javascript or jquery. I am using razor view engine. I am assignig id of check box like
@Html.CheckBoxFor(modelItem => item.CheckBox, new { id = "assignChkBx" + @item.ReportID})
I don''t know hoe to deal with it.
Thanks in advance.
推荐答案
http://www.codeproject.com/Articles/23124/Client-Side-Validation-for-the-CheckBoxes-Inside-a
我认为这对您有帮助....::)
http://www.codeproject.com/Articles/23124/Client-Side-Validation-for-the-CheckBoxes-Inside-a
i think it will help you.....:)
您在按钮单击事件内部写了类似checkbox.checked == true
you have write like checkbox.checked==true inside button click event
这篇关于使用javascript或jquery验证复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文