Here I will explain how to Check a Checkbox is Checked or Not Using Java Script.
just put this function on button click event where you need to validate.
function SelecteAtleastOne() {
var IsChecked = 0;
var gridView = document.getElementById("<%=UltGrdResult.ClientID %>");//Grid Id
var checkBoxes = gridView.getElementsByTagName("input");
for (var i = 0; i < checkBoxes.length; i++) {
if (checkBoxes[i].type == "checkbox" && checkBoxes[i].checked) {
return;
}
}
alert('Please select at least One Record..!');
return false;
}
just put this function on button click event where you need to validate.
function SelecteAtleastOne() {
var IsChecked = 0;
var gridView = document.getElementById("<%=UltGrdResult.ClientID %>");//Grid Id
var checkBoxes = gridView.getElementsByTagName("input");
for (var i = 0; i < checkBoxes.length; i++) {
if (checkBoxes[i].type == "checkbox" && checkBoxes[i].checked) {
return;
}
}
alert('Please select at least One Record..!');
return false;
}
Comments
Post a Comment