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;
<input type="text" name="text1" onkeypress="return maskKeyPress(event)"> 

Times Viewed: 2

Leave a Reply

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