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 6689563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:32:03+00:00 2026-05-26T05:32:03+00:00

http://whodateswhere.com/auto/ This is my site I’m building. Where it shows: Make: Model: I’d like

  • 0

http://whodateswhere.com/auto/
This is my site I’m building.
Where it shows:
Make:
Model:
I’d like to know, after the first is chosen, how do I let the second drop down know it will be from that make?

Here is the code:

<script type="text/javascript">
$(function(){
    $.get('makes_models.php', function(data){
       $('#ajax_make_select').html( data ); 
    });

    // on change of dropdown1 populate dropdown2 with the respective data 
    $('#ajax_make_select').change(function(){
        $.get('models.php',{ make: $('ajax_make_select').val() }, function(data){
            $('#ajax_model_select').html( data ); 
        }); 
    }); 
}); 
</script>

with the makes_models.php code is:

<select>
<option value=999>Select a Make</option>
<option value=1>Acura</option>
<option value=2>Audi</option>
<option value=3>BMW</option>
</select>

How would I go about coding the second file? “models.php”

if Acura is chosen, I would like it to display

<option value=1>MDX</option>
<option value=2>RDX</option>
<option value=3>RL</option>
<option value=4>TL</option>
<option value=5>TSX</option>
<option value=6>ZDX</option>
  • 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-05-26T05:32:04+00:00Added an answer on May 26, 2026 at 5:32 am

    I suggest you check out my answer here.

    http://jsfiddle.net/tBrXt/2/

    In response to how you would code the second file, use the switch/case statement:

    <?php
        switch($_GET['make']) {
            case "acura":
                echo json_encode(array("MDX","RDX","RL","TL","TSX","ZDX"));
                return;
            case "ford":
                echo json_encode(array('f150','mustang','etc'));
                return;
        } 
    ?>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://msdn.microsoft.com/en-us/library/system.resources.resxresourcewriter.aspx In this link and others like it, I see code to write in
http://support.microsoft.com/kb/276505 This site has a download for a Win32 application wizard. I am currently
http://developer.android.com/guide/topics/manifest/service-element.html#proc What are the differences? If the name assigned to this attribute begins with
http://www.sitepoint.com/build-to-do-list-30-minutes/ So I was doing this (http://www.sitepoint.com/build-to-do-list-30-minutes/) tutorial and everyting went OK. but now
http://msdn.microsoft.com/en-us/library/ms379570(v=vs.80).aspx I know that Arrays in .net is stored in a contiguous fashion. (
http://jsbin.com/ofojis/edit#preview http://jsbin.com/ofojis/edit#source Why is the top border of this inline element not displaying? Adding
http://www.sitefinity.com/devnet/forums/sitefinity/developing-with-sitefinity/override-how-page-title-is-generated.aspx#2050837 I would like to override how the page titles for all pages on
http://2012.delineamultimedia.com/delinea_new_12.html#home_portfolio_botm_bg This portfolio template has a section that includes what looks to be a
http://www.phpied.com/when-is-a-stylesheet-really-loaded/ Using this solution has worked great for loading a stylesheet with a callback,
http://www.myserver.com/exile?Key1=Value1&Key2=Value2 When i get a request in this format to my server, how do

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.