If you have the text box then you have to handle the onkeypress event
You can use the following function to restrict the users
function keypresshandler(event)
{
var charCode = event.keyCode;
//Non-numeric character range
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
}