Jquery ui Autocomplete Combobox - changed not firing

前端 未结 3 1351
故里飘歌
故里飘歌 2021-01-13 12:10

I need help with JQuery UI Autocomplete Combobox. I cannot get the \"CHANGED\" event to fire no matter what. I have pulled together this widget from various examples.

<
相关标签:
3条回答
  • 2021-01-13 12:32

    simpler way to detect the user has changed the combobox Try this:

    $("#combobox").combobox({ 
        select: function (event, ui) { 
            alert(this.value);
        } 
    });
    
    0 讨论(0)
  • 2021-01-13 12:32

    You can use this also:

    $( "#combobox" ).change(function() {
      alert( ".change() called." );
    });
    
    0 讨论(0)
  • 2021-01-13 12:38

    Awesome and almost perfect! It seems the above statement does not initialise the combobox to default selected values. I got it working by doing this:

    jQuery("#select_address").combobox({ 
        select: function (event, ui) { 
            alert(jQuery(this).attr('id'));
        } 
    });
        jQuery("#select_address").val("default").combobox("refresh");
    
    0 讨论(0)
提交回复
热议问题