JRS: In article <43**********@x-privat.org>, dated Wed, 14 Sep 2005
12:06:19, seen in news:microsoft.public.scripting.jscript, Davey
<da***@hello.com> posted :
I want to validate that the data entered by a user is correct before they
submit the form.
You can only do that if you know what it should be, and in that case you
don't need to bother with the form.
How do I validate the following (or what functions/classes do I use):
- Ensure a text field is not empty
- Ensure that a text field contains only numeric values
- Ensure that the contents of a text field is shorter than a certain length
- Remove commas and other formatting from a field before submission
For checks of compliance with a given format, which is not the same
thing as before, see <URL:http://www.merlyn.demon.co.uk/js-valid.htm>.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.