JRS: In article <31**************************@posting.google.com >,
dated Thu, 19 Aug 2004 16:02:04, seen in news:comp.lang.javascript,
Aionius <ai*****@hotmail.com> posted :
I have a form (textbox) which
accepts a series of numbers in format 9999-9999-9. Now i want to
filter all inputs to the textbox. let's say 1234-1234-1 is a valid
input, 12345-123-2 is an invalid input.
/^\d\d\d\d-\d\d\d\d-\d$/
<URL:http://www.merlyn.demon.co.uk/js-valid.htm>
If the data is supplied and used elsewhere as dddd-dddd-d, then it will
be easier for the operative to insert it in that form; I would not
choose to split it into three boxes.
--
© 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.