Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:18:06+00:00 2026-06-04T16:18:06+00:00

I need to create 3 dependent drop downs related to each other. So if

  • 0

I need to create 3 dependent drop downs related to each other. So if the first one is selected, related data will be shown in the 2nd drop down, and when an option is selected in the second drop down, in the 3rd drop down some related data will be shown.

And i need to use $_GET on this form, so if a specific option in the second one is slected a massage shows up, and when an option is the 3rd drop down is seleted, the page redirects for example to http://www.google.com. And i need two none related data in the first filed, so when they are selected, the page redirects for exaple to http://www.msn.com.

I know it needs JavaScript, but unfortunately I do not know JS for now.

And please do not use ” this.value” for sending parameters to JavaScript, because it conflicts with one of my other codes.

( And I don’t want the page to reload )

something like this :

Drop down 1  ----------------------- drop down 2  ----------------------- drop down 3

option 1 ( redirect to msn.com)

option 2 ==========================> Option 100 ======================> Option 500
                                     Option 101                         Option 501
Option 3 (redirect to google.com)    Option 102 (message:Hello )
                                     Option 103 ======================> Option 700
                                                                        Option 701

I tried hard to explain it, I hope you get what I was trying to say.

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:18:08+00:00Added an answer on June 4, 2026 at 4:18 pm

    Here is a quick and dirty answer…

        <html>
          <head>
            <script type='text/javascript'>
              var drop3Options = {"100":["500","501"],"103":["700","701"]};
              function drop1Change(){
                var value = document.getElementById("drop1").value;
                if(value == "msn")
                  window.location.href = "http://www.msn.com";
                else if(value == "google"){
                  window.location.href = "http://www.google.com";
                }                
              }
              function drop2Change(){
                var value = document.getElementById("drop2").value;
                var drop3List = document.getElementById("drop3");
                if(drop3Options[value]){
                  drop3List.options.length = 0;
                  for(var i = 0; i < drop3Options[value].length; i++){
                    drop3List.options[i] = new Option(drop3Options[value][i],drop3Options[value][i]);
                  }
                }
              }
            </script>
          </head>
    
          <body>
            <form method='GET' action='serverScript.php'>
              <select id='drop1' onchange='drop1Change()'>
                <option value='msn'>MSN</option>
                <option value='dr2'>DROP 2</option>
                <option value='google'>GOOGLE</option>  
              </select>
    
              <select id='drop2' onchange='drop2Change()'>
                <option value='100'>100</option>
                <option value='101'>101</option>
                <option value='102'>102</option>  
                <option value='103'>103</option>              
              </select>         
    
              <select id='drop3'>
                <option value='500'>500</option>
                <option value='501'>501</option>
              </select>
              <input type='submit' value='SUBMIT'/>
            </form>
          </body>
        </html>
    

    Obviously I don’t know what exactly you are using this script to do, so it is hard for me to make assumptions and give you better code, but this will do what I understood the question to be.. I also don’t know what server side scripts you will be sending this to. But just change the ACTION attribute in the form to reflect the location of the server script..

    The javascript has one global variable (drop3Options). This is an object with two properties which hold 2 arrays for the select 3 options..

    So drop3Options[‘100’] holds an array [‘500′,’501’]
    and drop3Options[‘103’] holds an array [‘700′,’701’]

    when you change a selection box, it calls the appropriate method, this is done by adding the “onchange” attribute to each select element, and it calls the function which looks at the value and does things accordingly

    I assume you will need to do more than this, so comment with more specifics and I will gladly help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A C# program I am working on will need to export data to one
I need to create this url: www.example.com/directory/[state]-financial-planners Where [state] will be different depending on
Need to create a custom DNS name server using C which will check against
I have 6000 data of district, subdistrict. I need to represent this on dependent
I need to add a select box next to each field in a create/update
I need to create a class that will encrypt the text and sends that
First I decided to create one Interface called it IDataAccessLayer and started putting everything
I'm trying to create a dependent select form like this one on AjaxRay .
I need to create a ValidationRule to test response bytes including responses for dependent
I have dependent and independent classes, I need to create database connections in these

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.