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
Jason Young
NA
2
0
Get element ID from a clicked checkbox into numeric variable
Apr 14 2009 11:24 AM
I have a form with 200 plus checkboxes. When the checkbox is checked onClick passes (this) to a Javascript function. I need to get the element array ID of the just checked checkbox into a numeric variable. The following routine never finds a match. The value returned in thisCheckID is blank when I send it to a text field. function getcheckboxid(formobj) { var checkboxname=formobj.name; var checks = document.getElementsByTagName("INPUT"); var len = checks.length; var thisCheck, thisCheckID; for (var i = 0; i < len; i++) { if (checks[i].name == checkboxname) { thisCheckID = checks[i].id; } document.form1.text1.value=thisCheckID; }
Reply
Answers (
0
)
In a word doc page howmany words are highlighted in green, yellow,etc using C#
MDI Child show and reactivate