Hi, at first I would like to know if there's any reason why
documentation of autocomplete have been removed from UI documentation?
However my real problem is to change url option dynamicaly, when
change event is triggered:

my html code:
-------------------------
                    <form action="" method="post">
                        <input type="text" name="search_input"
id="autocomplete">
                        <input type="submit" value="" title=""
class="search_submit" >
                        <span id="lang_menu">
                             <input type="radio" value="lv"
name="lang_radios"id="lv_radio">lv
                             <input type="radio" value="en"
name="lang_radios"id="en_radio">en
                             <input type="radio" value="de"
name="lang_radios"id="de_radio">de
                        </span>
                    </form>
------------------------

js code:
------------------------

$(document).ready(function(){
        var checked_lang = $("#lang_menu :checked").val();
        $("#autocomplete").autocomplete( {
                url:            
"<?=base_url()?>meklesana/autocomplete_results/"+checked_lang,
                max:            2,
                type:           "POST"
        });
        $("#lang_menu input").change(function(){
                checked_lang = $(this).val();
                $("#autocomplete").autocomplete( "flushCache" );
                $("#autocomplete").autocomplete( "setData",{
                        url: "<?=base_url()?>meklesana/
autocomplete_results/"+checked_lang,
                });
        });
});

------------------------

The idea is to changed the url acording to checked radio button. But
url option is changed only when data is submited and setData in change
event does not work. Is it a bug with autocomplete or a logic error in
my code?

PS: option "type" is added by modifying autocomplete code as advised
here:
http://groups.google.com/group/jquery-en/browse_thread/thread/aafa603741cf309/9577338ad3c6022a?hl=en&lnk=gst&q=autocomplete+%24_post#9577338ad3c6022a

Reply via email to