Add line to page based upon selection from drop-down box


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Add line to page based upon selection from drop-down box

Hybrid View

  1. #1
    Dean Guest

    Add line to page based upon selection from drop-down box


    I'm trying to work on a page that will add a new table row to an existing
    table based upon a selection from a drop down box. The box will have 3 selections;
    Select, Single-User, Multi-User. Only if the user selects Multi-User should
    the new table row display.

    Any ideas on how I can do this?

    Thanks,

    Dean

  2. #2
    Michael Guest

    Re: Add line to page based upon selection from drop-down box


    Dean,
    Assign a class to the TR and use styles to hide the TR. Example style tag,
    tr.dynamic {
    display:none;
    }
    Then create a function called say, showRow().
    Then use the onchange() or onclick() event handler to set off the function
    to changes the styles display value from none to block or inline.
    Just assign an ID to the row and use the getElementById property of the document
    object to reference the row to dynamically display.

    I could be more detailed if I knew what was to appear in that new table row
    but I hope this helps.

    Good luck and let me know if you have any questions,
    Michael

    "Dean" <satchmo82@hotmail.com> wrote:
    >
    >I'm trying to work on a page that will add a new table row to an existing
    >table based upon a selection from a drop down box. The box will have 3

    selections;
    >Select, Single-User, Multi-User. Only if the user selects Multi-User should
    >the new table row display.
    >
    >Any ideas on how I can do this?
    >
    >Thanks,
    >
    >Dean



  3. #3
    Manoj Guest

    Re: Add line to page based upon selection from drop-down box


    Hi Dean,

    I can think of two ways of doing this,
    1) You can always have the "new" row and keep it hidden till the user selects
    "Multi User". and hide it for other options
    2) Add the row as the user selects the "Multi User option"--
    // Inserts a row into the table
    tblName.insertRow();
    // Inserts individual cells for each row
    for(iColCount=0; iColCount<=iCols;iColCount++){
    tblName.rows[tblName.rows.length-1].insertCell(iColCount);
    }

    Hope this helps.

    "Dean" <satchmo82@hotmail.com> wrote:
    >
    >I'm trying to work on a page that will add a new table row to an existing
    >table based upon a selection from a drop down box. The box will have 3

    selections;
    >Select, Single-User, Multi-User. Only if the user selects Multi-User should
    >the new table row display.
    >
    >Any ideas on how I can do this?
    >
    >Thanks,
    >
    >Dean



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center