File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes showing cursor in textBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "showing cursor in textBox" Watch "showing cursor in textBox" New topic

showing cursor in textBox

Debashree Halder
Ranch Hand

Joined: Jul 27, 2005
Posts: 81
Hi here I'm using onFocus event on a textbox which will call the following function:

function clearDateField(fieldName)
if (document.getElementById(fieldName).value == "mm/dd/yyyy")
document.getElementById(fieldName).value = "";
return true;

The problem is it is making foucs on the textbox after I press TAB key but it is not showing the cursor. Only if I type something then only the cursor is coming....

How to make the cursor visible after pressing the Tab key from the previous field?


Debashree Halder<br />SCJP 1.5<br />Washington DC
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
Are you using onblur or onchange on the field to call that function?

Debashree Halder
Ranch Hand

Joined: Jul 27, 2005
Posts: 81
I am using onfocus to call that function
I agree. Here's the link:
subject: showing cursor in textBox
Similar Threads
value of a textbox from a tabbed pane control
Replace keycode value in Firefox
Delete A Part of "," seperated Text Box
Save button with Ajax
JSF and javascript