I am using jQuery autocomplete with multiple input boxes interconnected, i.e. when inserting some value in the first input box and losing focus, the following input boxes get affected (i.e. values are filtered accordingly). Then I can focus and another input box and start typing some value, so that I get both filters applied (typed value and according to previous input box value).
Also, I setup an event for cleaning ALL input boxes when deleting all characters from an input box:
if (inputBoxTrigger.val().length == 0 && (event.keyCode == BACKSPACE || event.keyCode == DELETE)) {
jQuery.each(inputObjectArray, function (i, obj) {
obj.val("");
});
}
So, I cleanup everything when I just removed last character in the current input box. However, I could do the following: 1) Select the content of an input box (e.g. via mouse or holding shift) 2) Start typing something in this input box without pressing backspace or delete buttons
In this case, the input box gets cleared and a new character is inserted, but I do not catch this situation. I attempted to drop the check on the backspace/delete button keyCode, but is does not work: when leaving an input box, the new input box is empty, so I just clean up everything (including previous input boxes).
Any ideas?