如何使用javascript选择gridview中的第5个复选框? [英] how to select upto only 5th checkbox in gridview using javascript?
本文介绍了如何使用javascript选择gridview中的第5个复选框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用javascript在gridview行中选择最多5个复选框?
例如,如果我选择了第4行,请选中复选框第1行至第4行的所有复选框
解决方案
< blockquote> GridView在浏览器上呈现为html表,请参阅以下演示并进行调整:
https://jsfiddle.net / pdq9hrwj / [ ^ ]
您必须使用ClientID在运行时识别gridview的实际ID,请阅读更多信息:
ASP.NET 4.0客户端ID功能 [ ^ ]
how to select upto 5 checkbox in gridview row using javascript?
e.g if i selected 4th row means, check all checkbox from 1st row to 4th row of checkbox
解决方案
GridView is rendered as html table on browser, see the following demo and adapt:
https://jsfiddle.net/pdq9hrwj/[^]
You wil have to use ClientID to identify the actual id of the gridview at runtime, read more:
ASP.NET 4.0 Client ID Feature[^]
这篇关于如何使用javascript选择gridview中的第5个复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文