0

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 me know if you have any query.Thanks!

3

1 Answer 1

0

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;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.