www.webdeveloper.com
Results 1 to 2 of 2

Thread: Dropdown box to add or remove table rows

  1. #1
    Join Date
    May 2009
    Posts
    4

    Dropdown box to add or remove table rows

    Hi

    Wondering if someone can help. Below is the code that I have so far. What Iím after doing is when a number is selected on the dropdown box that the number of rows with the text boxes in the table below.

    In other words, if the number three is selected from the drop down, there would be three rows in the table with text boxes in. if 5 is selected then 5 rows etc.

    Hope that this makes sense and hope that someone can help me with this.

    Thanks

    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="/itmedia/Style/style.css">
    </head>
    
    <body>
    <table width="278" border="0">
      <tr>
        <td width="220"><h3>New Equipment</h3></td>
        <td width="48"><select name="select2">
            <option>1</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
            <option>6</option>
            <option>7</option>
            <option>8</option>
            <option>9</option>
            <option>10</option>
        </select></td>
      </tr>
    </table>
    <table width="59%" id="table1">
      <tr>
        <td width="70">&nbsp;</td>
        <td width="151">
          <p align="center">PC Number</td>
        <td width="150">
          <p align="center">MO Number</td>
        <td width="150">
          <p align="center">PR Number</td>
        <td width="151">
          <p align="center">AX Number</td>
      </tr>
      <tr>
        <td>Asset Tag</td>
        <td width="151">
          <p>
            <input type="text" name="PCNumberNew1" size="21">
        </p></td>
        <td width="150">
          <p>
            <input type="text" name="MONumberNew1" size="21">
        </p></td>
        <td width="150">
          <p>
            <input type="text" name="PRNumberNew1" size="21">
        </p></td>
        <td width="151">
          <p>
            <input type="text" name="AXNumberNew1" size="21">
        </p></td>
      </tr>
    </table>
    
    </body>
    </html>

  2. #2
    Join Date
    Aug 2007
    Posts
    130
    hey there, follow this link

    http://www.webdeveloper.com/forum/sh...d.php?t=184818

    all I did was search for this in google and I found the solution on this site. you will need to look through the second post, if you cpy and past it there code does work. try putting there <script> in your page then look at the <table> and the <select> you will need to mess in there a bit. try to get it working from there and if you have trouble repost

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles