Click here to Skip to main content
15,910,277 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is my script for selectmenu :

//JQuery UI :

$(".st-hotel-rate").selectmenu({
        change: function (event, ui) {
            console.log($(this).val());
        }
    });


But I need invoke selectmenu change event on other button click event.

and I am trying this script in click event but is not working :

What I have tried:

$(this).find('select.room-type').val('0').selectmenu('refresh').trigger('selectmenuchange');
$(this).find('select.room-type').trigger('change');

So here change event is not invoke.
Posted
Updated 3-Jan-17 18:16pm
Comments
Thomas Daniels 2-Jan-17 6:29am    
First you have an event on .st-hotel-rate but then you are triggering the event on .room-type. Is that intended or a bug?

1 solution

$( "#selectorid" ).selectmenu({
  open: function( event, ui ) {}
});
JavaScript
<pre lang="Javascript">


or using this code blog
$( "#selectorid" ).selectmenu({
  select: function( event, ui ) {}
});


$('#selectorid').on('selectmenuchange', function() {
    alert( 'x'); 
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900