diff --git a/jquery.select-to-autocomplete.js b/jquery.select-to-autocomplete.js index e6a16d5..9bbf06a 100755 --- a/jquery.select-to-autocomplete.js +++ b/jquery.select-to-autocomplete.js @@ -60,7 +60,7 @@ THE SOFTWARE. } $text_field.blur(function() { var valid_values = context.$select_field.find('option').map(function(i, option) { return $(option).text(); }); - if ( !($text_field.val() in valid_values) && typeof settings['handle_invalid_input'] === 'function' ) { + if ( ($.inArray($text_field.val(), valid_values) < 0) && typeof settings['handle_invalid_input'] === 'function' ) { settings['handle_invalid_input'](context); } });