I have nearly finished writing this code: http://jsfiddle.net/2Jkk9/11/
but I can’t figure out how to search the select box for the value in my text box and enable/disabled the button accordingly.
That’s probably enough explanation.. the code explains all…
Thank you :).
EDIT Here’s my original code from jsfiddle:
<select id="myselect">
<option>apple</option>
<option>banana</option>
<option>pear</option>
</select>
<br><br>
<input id="filter" type="text"/>
and
$(function() {
$('#filter').keyup(function() {
// if select box contains input then
// $('#mybtn').attr(disabled, 'disabled');
//}
//else {
// $('#mybtn').removeAttr('disabled');
//}
});
});
This should do what you want by filtering the options for ones matching the text and checking the length:
http://jsfiddle.net/infernalbadger/2Jkk9/16/