Log in

View Full Version : html form value onfocus



ggalan
09-20-2010, 11:54 PM
i have a form that has a title inside like this


<input type="text" name=prodname id=prodname size=25 value="product name" onfocus="this.value=''" style="border:none" />


so when you click into it the value disappears.

i have several input fields on the same page, how can i make it so that if nothing was entered then the value re-appears?

basically, i dont want a person clicking into field 1 and not entering anything then skipping around different fields and field 1 ~ x is empty without a title

ggalan
09-21-2010, 12:27 AM
found a tutorial here:
http://www.nkuttler.de/2008/09/20/html-forms-and-onclickonfocus/