Jquery-ui-combobox
jQuery Plugins

A simple Jquery ui select menu (combobox, dropdown) with selected value on change

0 124

HTML

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
     
<label for="combobox">Select a Programming language</label>
<select name="combobox" id="combobox">
<option value="">Select one...</option>
    <option value="Asp.Net">Asp.Net</option>
    <option value="Java">Java</option>
    <option value="JavaScript">JavaScript</option>
    <option value="Perl">Perl</option>
    <option value="PHP">PHP</option>
    <option value="Python">Python</option>
</select>     

JQuery

 $(function() {
     $( "#combobox" ).selectmenu({
         change: function( event, ui ) {
             console.log(ui);
             var selected_value = ui.item.value;
             alert("You selected : "+selected_value);
         }
     });
});

About the author / 

codeadmin

Leave a reply

Your email address will not be published. Required fields are marked *

*