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

  • Home
  • SEARCH
  • 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 4072050
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:50:08+00:00 2026-05-20T16:50:08+00:00

I have a weird problem , below are two simple get calls and returning

  • 0

I have a weird problem , below are two simple get calls and returning HTML from the other file. The HTML I am receiving has 3 comboxes and events on them selecting one combox populates other. Every thing works fine.

If I add the receiving HTML to the DIV I have. But if I call the file two times and add it to the two divs. If I select one combobox on the first set, even the second set also changing. Whatever the events on the first set of 3 boxes are automatically happening on the second set too and this is vice versa. But I want these two sets to be independent.

jQuery:

        $.get("cars.php",{Make:'GM', Model:'Chevy', Year:'2009'},
               function(percar){
                $("#perPlace").append(percar);
            });

        $.get("cars.php",{Make:'Honda', Model:'Civic', Year:'2008'},
               function(curcar){
                $("#curPlace").append(curcar);
            }); 

HTML:

<div id="perPlace" >
</div>

<div id="curPlace">
</div>

Returning HTML ( Cut down the CSS and values to make it simple ):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8">
        <title>Select test</title>
            <script type="text/javascript" src="../jquery-1.5.1.min.js"></script>
            <script type="text/javascript" charset="utf-8">
            $(function(){
              $("select#make").change(function(){
                var makeVar = $(this).val();
                var jqxhr =$.getJSON("select.php",{make: makeVar, ajax: 'true'}, function(j){
                  var options = '';
                  for (var i = 0; i < j.length; i++) {
                    options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
                    if( i==0){
                     populateYear(j[i].optionValue );
                    }

                  }
                  $("select#model").html(options);
                }).error(function(xhr, ajaxOptions, thrownError) {  alert(xhr.statusText); })
              })



              $("select#model").change(function(){
                 populateYear($(this).val());
              })
            })



           function  populateYear(modelID){
                $.getJSON("select.php",{model: modelID, ajax: 'true'}, function(j){
                               var options = '';
                               for (var i = 0; i < j.length; i++) {
                                 options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
                               }
                               $("select#year").html(options);
                             })

            }


    </head>



    <div class="field_container">
        <select id="make">

            <option value="1">GM</option>
            <option value="2">HONDA</option>
            <option value="3">FORD</option>
        </select>
        <select id="Model">
            <option value="1">Chevy</option>
            <option value="2">Pontiac</option>
        </select>

        <select id="Year">
            <option value="1">2000</option>
            <option value="2">2001</option>
            <option value="3">2002</option>
        </select>
          </div>
  • 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-20T16:50:09+00:00Added an answer on May 20, 2026 at 4:50 pm

    We had faced the same problem and this is how we resolved it.

    We prefixed the controls with the request (ex. GetCar(Honda) will prefix the controls as Honda_Make, Honda_Model, Honda_Year). This enabled us to get unique controls whenever we want that view (we use MVC). The way we handled the events is by passing in the control to the function (ex. PopulateYear(YearDropdown); and the way we call that function is PopulateYear($("#Honda_Year"));

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

Sidebar

Related Questions

We have a weird intermittent problem with saving from Word 2007 to our SharePoint
I have a WEIRD problem with Future.get() in Java. It returns always with an
i have a weird problem. i would like to delete an assembly(plugin.dll on harddisk)
I have a weird problem with images in visual web developer, I cant change
I have a very weird problem: sometimes when I call nHibernate update to an
I have a weird date rounding problem that hopefully someone can solve. My client
This is a weird problem I have started having recently. My team is developing
This is a really weird problem that I have been having. When I download
The following code demonstrates a weird problem I have in a Turbo C++ Explorer
This is kind of a weird problem, but I have to create a search

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.