web page drop down question

Posted on 2007-07-23
Last Modified: 2013-12-25
I would like to create a webpage with 2 drop down boxes.   but the second dropdown box text depends on what is selected in the first box.

doing this with Front Page and it is going to be in a form so something simple would be a great help
Question by:lefty431
    1 Comment
    LVL 4

    Accepted Solution

    Not sure if you've got this already, but there are a couple of ways to approach the task:

    The first way is to have the form submit to itself when the option is changed. When the form submits to itself, the form handler checks for the selection, and reads the next values from a database or wherever. This is actually the easier of the two methods, but more taxing on your web page since it wil resubmit each time.

    A second way is to store every option in javascript variables. When a selection is made, a javascript fires that reads the selected value, and loads the next values based on that selection. This is a client-side task is doesn't require a resubmit of your web page.

    Another easy way is AJAX, but I'm not sure how you could use this in Frontpage, but if you're adventurous, give that a search on the web .. it's pretty simple in other web publishing tools such as 'visual studio'

    I prefer the javascript method, but it requires more coding, but there are plenty of examples out there.
    See any of the following:

    It should look something like this if it were javascript .. stick it in your page somewhere:
    <script language=javascript>
        function DropDwnChgr()
                DD1.options[0] = new Option('Choose Option Again','0');
                DD1.options[1] = null;
                DD1.options[0] = new Option('Option1Option','value11');
                DD1.options[1] = new Option('Option1Option','value12');
                DD1.options[0] = new Option('Option2Option','value21');
                DD1.options[1] = new Option('Option2Option','value22');

    <select name=DD id=DD onchange="DropDwnChgr();">
        <option value=0>Choose Option</option>
        <option value=1>Option1</option>
        <option value=2>Option2</option>

    <select name=DD1 id=DD1>

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    Read about why website design really matters in today's demanding market.
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now