Trent Wyman


How to clear a form field value when a user clicks inside

Categories:

To display text within a form field and have that text disappear when a user clicks inside the field, add one of the following scripts to the element:

Example 1:
<input onfocus="this.value=''" type="text" value="some text" />

Example 2:
<input onfocus="this.select()" type="text" value="some text" />


Announcements

DrupalCon Denver 2012 - I'm Going!

Press Release:
Michael C. Carlos Museum

Read the press release announcing the Drupal redesign of Emory University's Michael C. Carlos Museum. View Press Release