Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please somebody help me with this problem. Its urgent.......

  • #3
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •