Hi Anthony,

Thanks for your reply.

> $(function() {
>   $("#no_table_locality_args").autocomplete({
>     source: "{{=URL('hubaddressbook', 'locality_args_autocomplete')}}" +
> "/" + $(select#no_table_word).val(),

I tried the above, which made the view's JavaScript invalid, I had to
add '' to make it valid JavaScript:

$('select#no_table_word').val()

Testing this, results in the following url:

.../init/hubaddressbook/locality_args_autocomplete/?term=Am

Adding option:selected: $('select#no_table_word
option:selected').val() as in http://api.jquery.com/val/ doesn't make
any difference. Also, according to the developer of the multiselect I
am using this should work: 
http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/

When I hard code the .val() part with "Coach":

$(function() {
  $("#no_table_locality_args").autocomplete({
    source: "{{=URL('hubaddressbook', 'locality_args_autocomplete')}}"
+ "/" + "Coach",
    minLength: 2
  });

It all works. The url:

.../init/hubaddressbook/locality_args_autocomplete/Coach?term=Am

Could the problem have something to do with the format in which
the .val() function returns the value when using the jQuery UI
MultiSelect?


In the html the value is stored in button.ui-multiselect span

<button class="ui-multiselect ui-widget ui-state-default ui-corner-
all" type="button" aria-haspopup="true" tabindex="0" style="width:
264px;">
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
<span>Coach</span>
</button>

This: $("button.ui-multislect").val() and this: $("button.ui-
multislect span").val() results in this url:

.../init/hubaddressbook/locality_args_autocomplete/undefined?term=Am



Kind regards,

Annet

Reply via email to