Jump to content

[SOLVED] Text box


jokerofsouls

Recommended Posts

to my knowledge you require some javascript to block input

which isnt my strongest field but try this

 

 

<html>
<head>
<title>Testing</title>
<script>
function checkForNum(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
</head>
<body>
<form name="tstForm">
<input id="tstField" type="text" size="10" onkeypress="return checkForNum(event);"></input>
</form>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/127293-solved-text-box/#findComment-658403
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.