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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:21:33+00:00 2026-06-11T13:21:33+00:00

I have an ajax query which pulls some JSON data and generates me a

  • 0

I have an ajax query which pulls some JSON data and generates me a row for each user with several select elements using .append() this works great. An example of one of the selects it generates is below:

    <select name="mailBox" id="mailBox1" class="mailbox">
      <option value="25">25 GB</option>
      <option value="50" selected="selected">50 GB</option>
      <option value="75">75 GB</option>
      <option value="100">100 GB</option>
      <option value="0">No Mail Box</option>
    </select>   

What I would like to do is when the user changes the selected value I would like to then do an ajax post to update the database, however I am having trouble detecting the change request

I have tried this:

$(function() {
    $('select').change(function(){
        // I have just stuck an alert in to show me if it has detected the change
    alert('hello');
    });
});

I have also tried using $('.mailbox') and also referencing the id directly $('#mailBox1') and can’t detect any change. Code works fine if the select boxes are static html.

EDIT* Full jQuery code:

$(function() {
      var csrf = $('[name="csrf_test_name"]').val();
       $.ajax({                                      
              url: '/index.php/ajax/getCompanyUsers', data: {csrf_test_name: csrf}, dataType: 'json',  success: function(data)        
              {
                for (var i in data)
                {

                    var email = data[i].email;
                    var files = data[i].file;
            
                    var emailForm = '<select name="mailBox" id="mailBox' + paramID + '" class="mailbox"><option value="25">25 GB</option><option value="50">50 GB</option><option value="75">75 GB</option><option value="100">100 GB</option><option value="0">No Mail Box</option></select>  ';
                    var filesForm = '<select name="fileStorage" id="fileStorage' + paramID + '" class="filestorage"><option value="25">25 GB</option><option value="50">50 GB</option><option value="75">75 GB</option><option value="100">100 GB</option><option value="0">No File Storage</option></select>';
                      
                  $('#wrapper').append('<div class="company-users-email">' + emailForm + '</div>' + '<div class="company-users-filestorage">' + filesForm + '</div>');
                                                            
                 $("#mailBox" + paramID + " option[value='" + email + "']").attr("selected","selected");
                 $("#fileStorage" + paramID + " option[value='" + files + "']").attr("selected","selected");
                                
                } 
              } 
            });
            
          $('.mailbox').bind("change", function(e){ alert("hello") });      
});
  • 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-11T13:21:34+00:00Added an answer on June 11, 2026 at 1:21 pm

    this works:

    $(function() {
        $('#mailBox1').bind("change", function(e){ alert("hello") });
    });
    

    http://jsfiddle.net/ej8Aa/

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

Sidebar

Related Questions

I have a simple ajax query to a file which basically returns in JSON
Possible Duplicate: jQuery won't parse my JSON from AJAX query So I have parsed
I have a web service with this form: http://<remote_domain_ip>/api/v1/search/?query=the_query Which results a JSON document
I have this login form which uses AJAX to query a database for checking
I have a PHP Code, that uses a web service to query some data.
I have an ajax code which passes data to php and then retrieves data
i have created custom query which i am sending via POST ajax but problem
I have this jquery.ajax form which populates data from the database and auto fills
I have an FQL query which is run on client side with JQuery. It
I have a scraper, which queries different websites. Some of them varyingly use Content-Encoding.

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.