Print Page | Close Window

Javascript forms: detect tab click

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=3108
Printed Date: 28 March 2026 at 9:08am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript forms: detect tab click
Posted By: aj2taylo
Subject: Javascript forms: detect tab click
Date Posted: 29 May 2003 at 6:12am

Hey there,

I'm trying to find a way to clear the default values out of some text fields when a user clicks on them or tabs into them.  I know how to do it when the user simply clicks on the text field (onClick = "this.value=''"), but not sure how to determine if the user has entered the text field via a tab click.

Any tips are appreciated.  Thanks.




Replies:
Posted By: KCWebMonkey
Date Posted: 29 May 2003 at 7:09am

don't use onClick...use onFocus

onFocus = "this.value=''"



Posted By: aj2taylo
Date Posted: 29 May 2003 at 7:26am

Thanks!




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net