TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mithun kumar
NA
20
17.9k
using javascript code to validate the checkbox in Grid view
May 29 2012 3:15 AM
Hi Friends,
<script type="text/javascript" language="javascript" >
function validateCheckBoxes() {
var isValid = false;
var gridView = document.getElementById('<%= GrdEmp.ClientID %>');
for (var i = 1; i < gridView.rows.length; i++) {
var inputs = gridView.rows[i].getElementsByTagName('input');
if (inputs != null) {
if (inputs[0].type == "checkbox") {
if (inputs[0].checked) {
isValid = true;
return true;
}
}
}
}
alert("Please select atleast one checkbox");
return false;
}
</script>
This code was working fine ...but today its giving me error:
Microsoft JScript runtime error: '0.type' is null or not an object
Thanks & Regards,
Mithun.
Reply
Answers (
2
)
How to use the oops concepts in Asp.net using C sharp?
Validation Controls