I think the problem is that the "source" attribute is set only once, on document ready, before any values are selected in the multiselect. Instead, maybe you can update the source attribute when the multiselect changes:
var base = "{{=URL('hubaddressbook', 'locality_args_autocomplete')}}" $('#no_table_word').change(function() { var url = base + "/" + this.val(); $("#no_table_locality_args").autocomplete('option', 'source', url); }); Since #no_table_word is a multiselect, what happens when multiple items are selected -- what is the value of val() in that case (is it a legal web2py arg)? Anthony On Wednesday, February 22, 2012 2:10:44 AM UTC-5, Annet wrote: > > Hi Alan, > > Thanks for your reply> > > I tried this: > > <script type="text/javascript"> > $(document).ready(function(){ > $("#no_table_word").multiselect({ > multiple: false, > header: "Close single select", > noneSelectedText: "Select a value", > selectedList: 1 > }); > > $('#no_table_word').change(function(){ > var singleValue = $("#no_table_word").val(); > alert(singleValue); > }); > > }); > > $(function() { > $("#no_table_locality_args").autocomplete({ > source: "{{=URL('hubaddressbook', 'locality_args_autocomplete')}}" > + "/" + $("#no_table_word").val(), > minLength: 2 > }); > }); > </script> > > > When I select an option from the multiselect an alert box shows the > selected value. However, when I start typing a locality in the > autocomplete field, in Firefox's Net/XHR tab, the URL still doesn't > contain the value from the select: > > .../init/hubaddressbook/locality_args_autocomplete/?term=Am > > I hope I provided you with sufficient information to help me solve the > problem. > > > Best regards, > > Annet. > >