开发者

Get selected row count in gridview javascript

I have a gridview that contains a .xls columns which has checkbox in its item template. If none of the checkbox is selected for that xls column and user clicks the submit button the alert should be fired saying that "no rows has been selected". I have written a JS for the same but i need to check as to how many checkboxes are selected by user. If it is zero than the alert should appear else alert should not appear.

My Quesiton: How to get number of rows checked in gridview through JS?

Below is JS which i have written

function zeroExportSelection() {
                 alert('Please select at least one record!');
                 return false;
             }

Let m开发者_JAVA百科e know if you have any query.Thanks!


You need to use a selector. If your results are contained in a div for example, use something like:

var checkedCount = $("#myDivId input:checked").length;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜