populate drop down menu

Discussion in 'Javascript' started by bwv871, Feb 15, 2004.

  1. bwv871

    bwv871 Guest

    Hello. In the form below I have two drop down menus; the customer selects a
    recipient and then selects a subject. I would like to change the way this
    works so that if the customer selects "information" in the first menu, for
    example, then only two options (information and returns) are available in
    the second drop down menu; selecting "sales" in the first menu would make
    only "products" and "models" available in the second drop down menu, etc. I
    am a complete beginner and would appreciate any modifications to the html
    below that would make this new functionality possible.
    Thank you.

    <html>
    <head>
    <title>Contact us</title>
    </head>
    <body>

    <p>Please use the form below to send us an email. Choose an addressee from
    the drop down list.

    <form name=form action=cgi-bin/formmail22.pl onSubmit="submitonce(this)"
    method=post>
    <table cellpadding="0" bgcolor="#ffffff">
    <tr><td><h4>Name:</td><td>
    <input type="text" name="realname">
    </td></tr>
    <tr><td align="left"><h4><b>Email:</b></td><td>
    <input type="text" name="email"></td></tr>
    <tr>
    <td align="left">
    <h4><b>To:</b></td>

    <td>
    <select name="recipient">
    <OPTION value='' >Please select...</OPTION>
    <option value='' >Information</option>
    <option value=''>Sales</option>
    <option value='' >Advertising</option>
    <option value=''>Webmaster</option>
    </td></tr>

    <tr>
    <td align="left"><h4><b>Subject:</b></td><td>
    <select name="subject">
    <OPTION value="" >Please select...</OPTION>
    <option value="information" >General Information</option>
    <option value="returns">Returns policy</option>

    <option value="products">Products</option>
    <option value="models">Models</option>

    <option value="rates">Ad rates</option>
    <option value="criteria">Ad criteria</option>

    <option value="problem">Report a problem</option>
    <option value="Other">Other</option>

    </select>
    </td>
    </tr><tr>
    <td><h4>Message:</td></tr><tr><td colspan="5">
    <textarea name="message" rows="9" cols="60">
    </textarea>
    </td></tr>
    <tr><td align="center" colspan="2">
    <input type='hidden' name='recipient' value=',
    , , '>
    <input type="hidden" name="redirect" value="http://foo.com/thanks.html">
    <input type="hidden" name="required" value="email,message">
    <input type="hidden" name="env_report" value="REMOTE_HOST, HTTP_USER_AGENT">
    <input type="hidden" name="print_config" value="email,subject">
    <input type="hidden" name="print_blank_fields" value="1">
    <input type="hidden" name="title" value="Email Confirmation">
    <input type="hidden" name="return_link_url"
    value="http://foo.com/thanks.html">
    <input type="hidden" name="return_link_title" value="">
    <input type="hidden" name="background" value="">
    <input type="hidden" name="bgcolor" value="">
    <input type="hidden" name="text_color" value="">
    <input type="hidden" name="link_color" value="">
    <input type="hidden" name="vlink_color" value="">
    <input type="hidden" name="alink_color" value="">
    <br><INPUT class="submit" type=submit value="Send Message">
    <input type="reset" value="Reset"></form>
    </p>
    </div>
    </p>
    </td></tr>
    </table></h6></p>
    </SELECT></FORM>
    </body>
    </html>
     
    bwv871, Feb 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    815
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,069
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    544
    msimmons
    Jul 16, 2009
  4. julian
    Replies:
    3
    Views:
    223
    Lord Unspecified
    Nov 5, 2003
  5. Greg Scharlemann

    Dynamic populate drop down menu

    Greg Scharlemann, Dec 9, 2003, in forum: Javascript
    Replies:
    4
    Views:
    160
    Thomas 'PointedEars' Lahn
    Dec 12, 2003
Loading...

Share This Page