I am calling .keyup
function of Search Textbox, and in that keyup()
, I am refreshing the GRID from the database.
Problem:
But the grid is getting refreshed for (special keys too ) arrow keys, number lock,function keys and all other keys and refreshing for those keys are unnecessary. Except backspace, return,tab,space,delete.
I want to construct a regular expression such that it filters out all the control keys.
Sample code:
$('#searchContent').keyup(function (e) {
var key = e.which;
if ( /*condition*/ ) {
return;
}
//my code goes here...
}
What I have done:
Searched net thoroughly and I came up with hotkey, but that doesn't solved my purpose. So, any smart regular expression are there?