From 079ddd141fb0723bfb2131a622c4be2c27bcbba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Ku=C4=8Dera?= Date: Wed, 15 May 2013 17:35:01 +0200 Subject: [PATCH] Fix of JavaScript "in" which was not working --- jquery.select-to-autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } });