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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:35:25+00:00 2026-05-31T16:35:25+00:00

I have this code: <div id=gll_select> <script> var caffe = $(#caffe).val(); $(#gll_select).load(<?php echo base_url()

  • 0

I have this code:

<div id="gll_select">
            <script>
             var caffe = $("#caffe").val();
             $("#gll_select").load("<?php echo base_url() ?>form/galleries", {id : caffe});  
            </script>
</div>

which loads this:

<select name="gll" id="gll">
    <?php foreach ($galleries as $key) : ?>
        <?php if($id == $key['caffe_id']) :?>
        <option value="<?php echo $key['id_gallery'] . " " . $key['name'] ?>"><?php echo $key['name'] ?></option>
        <?php endif; ?>
    <?php endforeach; ?>        
</select>

and this one:

$("#gll").on('change',function(){
    var cff_name = $("#caffe_name").val();
    var gll = $("#gll").val();
    var gll = gll.split(' ');
    var gll_id = gll[0];            
    var data = "cff_name=" + cff_name + "&gll_id=" + gll_id;
    $('table tbody').empty();
    $.ajax({                
                url: '<?php echo base_url() ?>upload/get_files',
                dataType: 'json', 
                data : data,
                success : function(data) {                   
                    var fu = $('#fileupload').data('fileupload'), 
                    template;
                    fu._adjustMaxNumberOfFiles(-data.length);
                    template = fu._renderDownload(data)
                    .appendTo($('#fileupload .files'));                    
                    // Force reflow:
                    fu._reflow = fu._transition && template.length &&
                    template[0].offsetWidth;
                    template.addClass('in');
                    $('#loading').remove();
                }
});
});

Problem is that on change nothing happens. What I need to do?

  • 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-31T16:35:26+00:00Added an answer on May 31, 2026 at 4:35 pm

    you should attach the handler for #gll element after the load() call has completed (which actually acts like an asynchronous ajax call): probably at the moment you have defined the handler for the change event before you load the html code, so nothing happen because the select doesn’t exist yet.

    try to change in this way

    $("#gll_select").load("<?php echo base_url() ?>form/galleries", {id : caffe}, 
        function() {
            $("#gll").on('change',function(){
            ...
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code snippet in an email layout: <div> <?php echo $this->Html->image('Layouts/default/Logo.png', array(
I have this code: <div id=star-rating> <script type=text/javascript> $(function(){ $('#star-rating form').submit(function(){ $('.test',this).html(''); $('input',this).each(function(){ if(this.checked)
I have this code that populates the div with the form input data: var
I have this code: var $msg = jQuery('<div></div>') .hide() .appendTo(document.body) ; if ($msg.is(:hidden)) {
I have this code : <div class=riga style=border-top:0;> <div class=col3 id=txtValoreCatastale>0,00 euro</div> </div> <script
I have code like this: <select name=caffe id=caffe> <option value=5>Red</option> <option value=6>nmfxnsdnx</option> </select> <div
I have this code: <div class=LoginBox> <form id=form2 runat=server> <asp:ContentPlaceHolder ID=ContentPlaceHolder2 runat=server> lolbags </asp:ContentPlaceHolder>
I have this code: function render(str) { var main = document.createElement('div'); with(main.style) { //style
I have this code that generates a WP menu: <div id=menu> <?php $args =
I have this JQuery code: $(div.notification).live(click, function(){ window.location=$(this).find(a).attr(href); var myId = $(this).attr(id); $.post(/videos/selected_notification.js, myId);

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.