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
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,097
    Thanks
    15
    Thanked 1 Time in 1 Post

    Lightbulb dynamically create table rows onChange of select drop-down menu

    I have this form setup, is there a way that i can have
    a drop down menu with values 1-15 that will change the value of
    a when changed and create the correct number of table rows?

    Code:
    <form name="form">
    <table>
    <tr><td><font class="font_heading">Mini Rules Administration</font></td></tr>
    </table>
    <table>
    <% for a = 1 to 6 %>
    <tr>
    <td><font class="font">Rule Heading</font></td>
    <td><input type="text" name="mini_heading" size="10" maxlength="1000"></td>
    <td><font class="font">Rule Content</font></td>
    <td><input type="text" name="mini_content" size="10" maxlength="1000"></td>
    </tr>
    <% next %>
    </table>
    </form>

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    I am not sure that I understand where the values in the drop down are coming from. Are they from a database table? Is the number of a determined by the number of results returned from a query on a database? Or is this determined some other way? You need to be more specific if you want some help.

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    Are you wanting this to happen as soon as the number is selected or with a form submit?
    If you're using a form submit just replace a with request.form("nameofdropdown")

    If you want it to happen automatically you'll need to use javascript to either rewrite the page or submit the form then you can carry on as above


  •  

    Posting Permissions

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