Hey all :)
I have a input field where i only wish users to type numbers
html: <input id="num" type="text" name="page" size="4" value="" />
jquery/ js:
$("#num").keypress(function (e){
if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)){
return false;
}
});
hope someone can help me.
btw: I'm not interesting in a larger jquery plugin to make the function work. (I have found some jquery-plugins , but there must be som other ways to fix it, with a smaller code)