Display Numbers Only

[Total: 0    Average: 0/5]

This script allow numbers only to be entered in text boxs (or any other controls).

Body Code:

<script language="javascript" type="text/javascript">
	function maskKeyPress(objEvent) 
	{
	  var iKeyCode;  	
	  iKeyCode = objEvent.keyCode;			
	  if(iKeyCode>=48 && iKeyCode<=57) return true;
	  return false;
	}
</script>
<form>
<input type="text" name="text1" onkeypress="return maskKeyPress(event)"> 
</form>

Times Viewed: 0

Leave a Reply

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