in firefox and mobile browser, Chinese character can not trigger filter event。
I found that jquery.autocomplete has the same bug...
following is the text ....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But the only regret is that the Chinese input method in the open, firefox3.0 the Chinese Pinyin is the automatic matching, while the input is triggered after the time the Chinese can not match; and under my IE6.0, but not in problem.
Analysis:
Autocomplete plugin on the user input characters trigger automatically match by "keydown" events of (can be analyzed jquery.autocomplete.js 92 lines), in IE6, when the input is open, enter the characters will not trigger "keydown ", only Chinese input is finished before the trigger, so the Chinese text input and latin no difference; But in firefox3.0, no matter whether the input open, keys will trigger the" keydown "event, with the result that Chinese input is completed, automatically match is just playing the part of the Chinese phonetic alphabet.
Before the amendment:
Solution:
Be found online at most practices are modified jquery.autocomplete.js 92 line, "keydown" replaced "keyup", but this is not a fundamental way, although such a change in firefox after the Chinese input in a timely manner to automatically match But the original plug-in Enter, tab and other important events mechanism destroyed, for example such a change, if your input is in a form in it, Enter the selected items from the original input to input directly into submission in form form, and this is not what we want.
Principle of my method is to add a plug-in triggered the original inquiry, which relates to occur when the input characters in the input field changed, re-query (called its internal onChange function), this is mainly for firefox, the most visited because of our system the IE and firefox. The input is just a change in firefox event is oninput, then we as long as the original jquery.autocomplete.js line 199, insert the following code:
Js code
. Bind ("input", function () (
/ / @ Hack by liqt: support for inputing chinese characters in firefox
onChange (0, true);
));
. Bind ("input", function () (
/ / @ Hack by liqt: support for inputing chinese characters in firefox
onChange (0, true);
)); Add the following into:
Js code
. Bind ("unautocomplete", function () (
select.unbind ();
$ Input.unbind ();
$ (Input.form). Unbind (". Autocomplete"). Bind ("input", function () (
/ / @ Hack by liqt: support for inputing chinese characters in firefox
onChange (0, true);
));
));
~~~~~~~~~~~~~~~~~~~
hope you can fix it ,thanks