带复选框的gridview的必填字段验证 [英] Required field validation for gridview with checkboxes

查看:87
本文介绍了带复选框的gridview的必填字段验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是我的问题.
我有一个带有两列复选框的gridview.我需要对其进行验证,以便在第1列中选择至少一个复选框,但在单击提交"按钮时,第2列复选框是可选的.

谁能帮我解决这个问题.

在此先感谢....

Hi,

Here is my question.
I have a gridview with two columns of checkboxes. I need to validate it as to select atleast one checkbox in column1,but column2 checkboxes is optional on clicking the submit button.

Can any one please help me in solving this.

Thanks in advance....

推荐答案

提交数据时,您可以使用javascript或对其进行验证.

查看本文可让您了解如何从客户端访问复选框,
GridView内部复选框的客户端验证 [
You can either use javascript or validate it when submitting the data.

Checking this article will give you an idea about accessing a checkbox from clientside,
Client-Side Validation for the CheckBoxes Inside a GridView[^]


谢谢!它工作正常. /> 但是,我有一个下拉列表选择的值,网格将基于该值进行绑定.
在这里,如果我使用Java脚本来验证网格,则无法获得下拉列表的常规验证.

如何克服这一难题?
能否请您先发布代码以验证下拉列表,然后需要使用javascript来验证网格

任何其他解决方案,请...
Thank you it is working fine.
But, I have a dropdownlist selected value based on which the grid will be binded.
Here, if I use Java script to validate grid, I am unable to get the normal validations for the dropdownlist.

How to overcome this one?
Can you please post the code to validate dropdownlist list first and then the grid needs to be validated using javascript
or
any other solution please...


这篇关于带复选框的gridview的必填字段验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆