JRS: In article <. com>,
dated Wed, 27 Sep 2006 10:03:50 remote, seen in
news:comp.lang.javascript,
posted :
>I envision a credit card text input box which only allows numbers and
>dashes -'s.... and after you type 4 numbers it inserts a dash, and so
>on until the sequence is complete. I have no idea how to write this
>JavaScript function except for the dream of how it works. You will
>greatly help me expand my capability and learning curve (and help me
>finish this dang project!) ... if you can help me with this. Thank you
>for any assistance.
)
That gets rather confusing for the unsuspecting typist.
IMHO, it's better to allow anything to be typed, and after that to strip
out all non-digits (with a RegExp) and redisplay the input with spaces
at the intervals that they occur on cards.
It's a good idea to read the newsgroup and its FAQ. See below.
--
© 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.