Skip to content

Commit

Permalink
Fix of JavaScript "in" which was not working
Browse files Browse the repository at this point in the history
  • Loading branch information
kuceram committed May 15, 2013
1 parent a82fe16 commit 079ddd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jquery.select-to-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down

0 comments on commit 079ddd1

Please sign in to comment.