I have two dropdown/select widgets on a form. I am trying to set the
options of the second select through an ajax call in jQuery, and then
execute further code. The ajax call is successful and correctly sets the
second select options, but it seems the code after the ajax call is not
executed at all. How to correct this?
view:
{{extend 'layout.html'}}` <h1>{{=title}} /This is the library/edit_user.html template</h1> {{=grid}} <script> jQuery("#no_table_region_id").change(function(){ region_id = $(this).val(); branch_id = jQuery('#no_table_branch_id').val(); ajax("{{=URL('library', 'branches')}}" + '?region_id=' + region_id, [], 'no_table_branch_id'); jQuery('#no_table_branch_id').val(branch_id); # this does not execute }); jQuery(document).ready(function(){ // todo: solve the unsettable branch_id jQuery("#no_table_region_id").change(); }); </script>