jquery UI Combobox ONCHANGE

前端 未结 8 969
死守一世寂寞
死守一世寂寞 2020-12-02 13:28

how can I attach an onchange function in a jqueryUI combobox? Here is my code:

$(\".cmbBox\").combobox({
     change:function(){
         alert($(this).val()         


        
8条回答
  •  既然无缘
    2020-12-02 13:49

    IMHO, an even simpler way to detect the user has changed the combobox (without having to tweak the jQuery UI autocomplete combobox source code) is as follows; this works for me. It's repetitious if you've got lots of them, though surely there's a way to refactor. Thanks to all who have studied and explained this widget at length, here and elsewhere.

    $("#theComboBox").combobox({ 
            select: function (event, ui) { 
                alert("the select event has fired!"); 
            } 
        }
    );
    

提交回复
热议问题