Numbers Only Allowed Within

[Total: 0    Average: 0/5]

This allows you to enter only numbers into form data.

Body Code:

<SCRIPT>
function KeyCheck(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (((keycode>47) && (keycode<58) )  || (keycode==8)) { return true; }
else return false;
}

</script>
<form name="cart">

<input type="text" 
       name="p_16948_num" 
	   value="23" 
	   onKeyPress="return KeyCheck(this,event);" 
	   size="5">

<input type="text" 
       name="p_16865_num" 
	   value="12" 
	   onKeyPress="return KeyCheck(this,event);" 
	   size="5">

<input type="text" 
       name="p_15871_num" 
	   value="3123" 
	   onKeyPress="return KeyCheck(this,event);" 
	   size="5">

</form>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *