Skip to main content
May 3, 2006
Question

Clear one text box when other gets focus

  • May 3, 2006
  • 2 replies
  • 310 views
I have a search box with two text fields, one for products and one for companies. I want to have one box be cleared when the other box gets focus. For example, a user types in NEC in the product box, and realizes that it is the wrong box. The user is supposed to type that in the company box. When the company box gets focus, the product box is cleared.

Anny suggestions
This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
May 4, 2006
you're welcome.
kglad
Community Expert
Community Expert
May 4, 2006
you could use two different functions is you want to allow a user to change focus from a textfield and return to the same textfield without erasing the previously entered text. otherwise for textfields tf1 and tf2, try:

May 4, 2006
That worked!

Thanks