...

View Full Version : Implementing Mail Inbox Scenario Through Dom



maruvada
03-09-2006, 04:07 PM
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
03-10-2006, 12:15 AM
Please somebody help me with this problem. Its urgent.......

Beagle
03-10-2006, 02:50 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum