Re: How do I make these into a real type?
[ Follow Ups ] [ Post Followup ] [ Intranet eXchange ] [ IDM Home ]
Posted by Chris Davies on August 25, 2000 at 7:6:6:
In Reply to: Re: How do I make these into a real type? posted by Jon Hanlon on August 24, 2000 at 19:30:36:
Thanx.... Your type checking routine doesn't work, but I have one of my own which i'm already using. besides which using parseFloat on an alpha type is not a fatal error. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function validate(field) { var valid = "0123456789" var ok = "yes"; var temp; for (var i=0; i<field.value.length; i++) { temp = "" + field.value.substring(i, i+1); if (valid.indexOf(temp) == "-1") ok = "no"; } if (ok == "no") { alert("Invalid entry! numbers are accepted!"); field.focus(); field.select(); } } // End --> </script> this is a script that checks a field to ensure it has only numbers, although you could add other chars....
Follow Ups:
|