wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes Populating a character while entering value in text field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Populating a character while entering value in text field" Watch "Populating a character while entering value in text field" New topic
Author

Populating a character while entering value in text field

Shrikanth Nekkanti
Ranch Hand

Joined: Jul 12, 2007
Posts: 48
Hi all,

I have a text which accepts only numbers.
Now i want to populate a dot(.) automatically after entering three characters in that text field.

How can i resolve this using javascript.
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
Use the "onkeyup" event of the textbox to call a function passing the reference to the textbox => "fnABC(this)"

This function can do something like:
==========================
 
wood burning stoves
 
subject: Populating a character while entering value in text field