0

I have an HTML FORM with the following dropdown menu.

How many are Attending?
<select id="NoAttending">
    <option value=1>1</option>
    <option value=2>2</option>
    <option value=3>3</option>
    <option value=4>4</option>
    <option value=5>5</option>
</select>

The rows below will depend on user's option. So if the user selects "3" three rows will be generated on the fly and shown each column with 2 input fields for FName and LName.

<tr>
    <td>First Name:
        <input id="fname1" name="fname" type="text">
    </td>
    <td>Last Name:
        <input id="lname1" name="lname" type="text">
    </td>
</tr>
<tr>
    <td>First Name:
        <input id="fname2" name="fname" type="text">
    </td>
    <td>Last Name:
        <input id="lname2" name="lname" type="text">
    </td>
</tr>
<tr>
    <td>First Name:
        <input id="fname3" name="fname" type="text">
    </td>
    <td>Last Name:
        <input id="lname3" name="lname" type="text">
    </td>
</tr>

How can I do this? Thank you!

ceci
  • 429
  • 1
  • 7
  • 22
  • possible duplicate of [Adding input elements dynamically to form](http://stackoverflow.com/questions/14853779/adding-input-elements-dynamically-to-form) – Asons Sep 23 '15 at 18:32
  • 2
    You need to make an attempt, and then show your work and explain a specific problem. This is common functionality with many good examples right here on SO. – isherwood Sep 23 '15 at 18:48

0 Answers0