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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:45:26+00:00 2026-06-09T02:45:26+00:00

I am trying to setup a cascading dropdown with python/jquery/ajax. The first dropdown is

  • 0

I am trying to setup a cascading dropdown with python/jquery/ajax.

The first dropdown is manually setup in the html code.

The second/third dropdowns are dependent on the previous selections.

When I select the first dropdown i am able to populate the second dropdown with the data through the ajax call. The issue is with the second -. 3rd dropdown.

The call does not come from the client at all. the html code genrate seems to be correct as firebug gives the correct output. I am thinking is that the client is not being refreshed to enable the new dynamic content to be used with the jquery which is already loaded.

I haven’t added my python code as for the second -> dropdown the call doesn’t even leave the client so I don’t think this is the issue.

Will add it if needed though.

I have looked and looked for examples and have seen some similar results but nothing fruitful

Any help appreciated.


jquery:

$(document).ready(function(){

        $(".dynamic-select").change(function(){
            var url_params = '?' + $(this).attr('name') + '=' + $(this).val() + '&sid=' + $(this).attr('id');
            $.getJSON('ajax' + url_params,function(data) {

                $("#"+ data.element_id).replaceWith(data.data);




    });

        });
    });

html snippet

            <select class="dynamic-select" id="test1" name="test1">
                <option value="#">Select</option>
                <option value="EU">Europe</option>
                <option value="NA">North America</option>
                <option value="AS">Asia</option>
            </select>


            <select class="dynamic-select" id="test2" name="test2">
                <option value="#">Select First Dropdown</option>
            </select>

            <select class="dynamic-select" id="test3" name="test3">
                <option value="#">Select Second Dropdown</option>
            </select>

firebug html output after selecting EU from first dropdown

<select id="test1" class="dynamic-select" name="test1">
<option value="#">Select</option>
<option value="EU">Europe</option>
<option value="NA">North America</option>
<option value="AS">Asia</option>
</select>
<select id="test2" class="dynamic-select" name="test2">
<option value="#">Select EU</option>
<option value="EU_EQ_JA">EU_EQ_JA</option>
<option value="EU_CR_AR">EU_CR_AR</option>
<option value="EU_EQ_MC">EU_EQ_MC</option>
<option value="EU_EQ_CS">EU_EQ_CS</option>
<option value="EU_EQ_CR">EU_EQ_CR</option>
<option value="EU_CR_GS">EU_CR_GS</option>
</select>
<select id="test3" class="dynamic-select" name="test3">
<option value="#">Select Second Dropdown</option>
</select>
  • 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-09T02:45:27+00:00Added an answer on June 9, 2026 at 2:45 am

    So I believe your problem is with the $(".dynamic-select").change(). That, just like bind and a couple other event triggers in JQuery, have to be set again as each element is added.

    If you use

    $("body").on('change','.dynamic-select',function(e){//some stuff here});
    

    instead it should work for all elements inserted into the DOM.

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

Sidebar

Related Questions

Trying to setup some validation on the add to cart button for the dropdown
When trying to setup a lock (pessimistic), with the following code: em.lock(controlnumbers, LockModeType.WRITE); em.refresh(controlnumbers);
im trying to setup two listeners for one button. Here is my code: This
I'm trying to setup Notepad++ to be able to edit a particular source-code file
Im trying to setup a simple environment: class Member < ActiveRecord::Base has_many :microposts, :dependent
I'm trying to setup error handling for the first time. It does actually work
Trying to setup a personal image upload/downloader webpage. I've viewed the msdn article on
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
Trying to setup and get going with the RestKit library for a cocoa project
Im trying to setup my asp.net mvc page like the following image: The header

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.