this sure doesn't look right $('#kiesgroep').change(function(){$.post....}).change(); remove 2nd change(). it's likely causing change to trigger Paul wrote: Hi there, This is what I'm trying to do:When a user selects a group in the first SELECT box, another SELECT box should be loaded from an external PHP-file (using MySQL), based on the group-id of the first SELECT box. I use this code: $('#kiesgroep').change(function(){ $.post("<?php echo base_url();?>php/kies_speltak.php", { groepid: $('#kiesgroep').val() }, function(response){ $('#kiesspeltakveld').fadeOut(); setTimeout("finishAjax('kiesspeltakveld', '"+escape(response) +"')", 200); }); return false; }).change(); function finishAjax(id, response) { $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } //finishAjax where #kiesspeltakveld is the field where the second SELECT box should be loaded, and #kiesgroep is the id of the first SELECT box. But now the problem is that the second SELECT box gets loaded when the page loads, NOT when the first SELECT box gets changed. Does anyone know why? |
- [jQuery] Problem with loading SELECT on change of other select Paul
- [jQuery] Re: Problem with loading SELECT on change of other s... Charlie
- [jQuery] Re: Problem with loading SELECT on change of other s... Matthew
- [jQuery] Re: Problem with loading SELECT on change of other s... shaded