HTML input field hint
I think for your situation, the easy and simple for your html input , you can probably add the attribute title
<input name="Username" value="Enter username.." type="text" size="20" maxlength="20" title="enter username">
You'd need attach an onFocus
event to the input field via Javascript:
<input type="text" onfocus="this.value=''" value="..." ... />
the best way to give a hint is placeholder like this:
<input.... placeholder="hint".../>
With a bit of JavaScript:
<input
value="Enter username..."
onfocus="if (this.value === 'Enter username...') this.value=''" ... />
HTML5 has a nice attribute for this, called placeholder
:
<input placeholder="Enter username.." ... />
but this attribute is not supported in old browsers.