Thursday, March 14, 2013

onkeypress should not allow alpha charecter

function functionAmount(e) { if (window.event) { code = event.keyCode; if ((code >= 48 && code <= 57) || code == 46) { } else { event.returnValue = false; } } else { code = e.which; if ((code >= 48 && code <= 57) || code == 8 || code == 0 || code == 46) { if (code >= 48 && code <= 57) { } } else { e.preventDefault(); } } }

No comments:

Post a Comment