Some hacker way
Perhaps you could do something like this after starting the plugin:
$(".searchbox").val($("#listBox1 :selected").val())
Since this plugin seems to make you select as follows:
<input type="textbox" id="__searchit2" class="searchbox"> <div id="__searchitWrapper2" style="display: none; vertical-align: top; overflow: hidden; border: 1px solid rgb(128, 128, 128); position: absolute;"> <select id="listBox2" style="padding: 5px; margin: -5px -20px -5px -5px;"> <option>Robinhood</option> <option>Rockford</option> <option selected="">Rome</option> <option>Ronda</option> <option>Rondon</option> <option>Rondonopolis</option> <option>Rongelap</option> </select> </div>
Plugin change
I added another plugin option called selected . If you set it to true , then the text box will display the selected option . Just add this extra option:
$("select").searchit({ textFieldClass: 'searchbox', selected: true });
Demo: http://jsfiddle.net/hungerpain/QuYJD/23/
source share