Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populating a dash

Status
Not open for further replies.

Maximus007

Technical User
Jul 26, 2004
248
US
Good morning everyone;

I interested in having a dash poplulate after the ninth character within an input field. If there's a website with this information please send me the url.

Thank you
 
You'll probably need to double check server side after submission in case someone pastes a value in the field or something like that, but this will work 95% of the time:
Code:
<input type="text" onkeyup="this.value = (this.value.length == 9) ? this.value + '-' : this.value">

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
Thank you! Do you have site that more informaton on this subject?
 
Do you have site that more informaton on this subject?

The best site on the internet for javascript material is here:

If you can't find what you need there then I usually just google it.

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top