I’m using this simple function to perform a regex filter on some data. My functions, digits, simply performs a regex on the input and filters out any data other than numbers. I don’t think that’s the problem though.
$(document).ready(function() {
var numberFields = "#adjusted,#historical,#projected";
$(numberFields).keyup(function() {
$(this).digits();
});
});
I have the function run on keyup. The problem is when the user presses the tab key to move to the next field, the next form field loses its focus. I’m assuming it’s being caused by the keyup event. How can I fix this? I’m using jQuery 1.7.2.
I ended up doing this instead:
Works well in IE 8.