Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-09-2006, 04:07 PM   PM User | #1
maruvada
New to the CF scene

 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
maruvada is an unknown quantity at this point
Implementing Mail Inbox Scenario Through Dom

Hello......

My problem is that the table that is displayed by me in a web page is dynamic...which i have obtained through DB using JSP.

Hence, how to address the rows of the table using seperate check boxes??
Since, I need to loop to create the check boxes even..just like the rows.

How do the check boxes need to be addressed(accessed) if all are not given different names..since i made a loop..addressing them by different names.....is that possible???

Plz guide me as how to address the checkboxes so as to access the values.....

Note:
THE SCENARIO I REQUIRE HERE IS JUST LIKE THE YAHOO MIAL WHERE IN I CLICK THE CHECKBOXES SO AS TO DELETE THE MAILS IN THE INBOX.

The same is the case here...I need to click on the checkboxes so as to delete or update some of the rows of the DYNAMICALLY growing or generated table.
maruvada is offline   Reply With Quote
Old 03-10-2006, 12:15 AM   PM User | #2
maruvada
New to the CF scene

 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
maruvada is an unknown quantity at this point
Please somebody help me with this problem. Its urgent.......
maruvada is offline   Reply With Quote
Old 03-10-2006, 02:50 PM   PM User | #3
Beagle
Senior Coder

 
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
Beagle is an unknown quantity at this point
You don't really need the names of the checkboxes technically, just the values of them. When you create the row in the JSP, also create the checkbox, and give the checkbox the value of the id of that mail message.

Then, assuming your table's id is mailTable:

var inputs = document.getElementById('mailTable').getElementsByTagName('input');

then loop over the inputs:

for (i in inputs)
{
if (inputs[i].type == "checkbox")
// *** do what you need
}

This will let you loop over your checkboxes and get the values out of them (inputs[i].value) and do what you want. Good luck.
Beagle is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:44 PM.


Advertisement
Log in to turn off these ads.