Tuesday, November 20, 2012

Avoid enter alpha charecters




$("#strPhone").keydown(function(event) { if ( event.keyCode == 46 || event.keyCode == 8 ) { } else { if (event.keyCode < 95) { if (event.keyCode < 48 || event.keyCode > 57 ) { event.preventDefault(); } } else { if (event.keyCode < 96 || event.keyCode > 105 ) { event.preventDefault(); } } } });

No comments:

Post a Comment