I think this may help you ...
<script type="text/javascript"> function validate(e) { return (e.charCode == 51 || e.charCode == 54 || e.charCode == 57) } </script> <form> <input name="name" type="text" onkeypress="return validate(event);" /> </form>
If you want to limit the number of occurrences, simply set the maxlength property for the input field.
Tuco May 25 '11 at 21:36 2011-05-25 21:36
source share