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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:28:35+00:00 2026-05-13T20:28:35+00:00

I have come into a bit of a problem. I am dynamically updating dropdown

  • 0

I have come into a bit of a problem. I am dynamically updating dropdown lists using JQuery and PHP. I am using the following JQuery code to run a PHP page and insert the results into the page:

$("#booking-form-area").change(function()
  {
  ajax_availabletimes();
  })

function ajax_availabletimes(){
  var venue_val=$("#booking-form-venue").val();
  var people_val=$("#booking-form-people").val();
  $("#booking-form-time-select-ajax").load("/booking/times-dropdown.php", {venueUID : venue_val, people : people_val}, function(){
  })
}

In times-dropdown.php I am basically doing some lookups and returning some html in the form of:

<select class="small" id="booking-form-time-select"><option value="-1">Select Time...</option><option value="12:00">12:00pm</option><option value="12:30">12:30pm</option><option value="13:00">1:00pm</option></select>

This is put into the #booking-form-time-select-ajax div.

However if I now try selecting something in the dropdown here it should fire the function (this works before a dropdown has been selected and $(“#booking-form-offer-select-ajax”).load has replaced the code):

$("#booking-form-time-select").change(function()
  {
  ajax_offerdropdown();
  })

I can only presume once JQuery has replaced the code in booking-form-time-select then it can’t use selectors? Any idea how to fix this? I have been reading up about $(data) function but it’s quite confusing and not sure it is what I am looking for?

  • 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-13T20:28:36+00:00Added an answer on May 13, 2026 at 8:28 pm

    Use .live() in this case:

    $("#booking-form-time-select").live('change', function(){
      ajax_offerdropdown();
    });
    

    This puts an event listener up at the DOM level that won’t get erased as the element is replaced.

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

Sidebar

Related Questions

I have added a group of radio buttons dynamically to the DOM using jQuery.
I have run into an interesting problem lately: Lets say I have an array
I have come across a problem in using the DataAdapter, which I hope someone
I am fairly new to coding in php and have come accross a bit
I'm new to CodeIgniter and have come into an issue with the insertion of
I am currently looking into color manipulation / selection etc and have come across
I am implementing C2DM push into an Android-app, and have come to the part
I'm doing some personal research into text analysis, and have come up with close
I have come across an annoying problem. I have made a system and now
I have come across scripts that use: isset($_POST['submit']) as well as code that uses:

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.