Forums

This topic is locked

OnClick Initial Value is removed

Posted 14 Jun 2004 21:54:45
1
has voted
14 Jun 2004 21:54:45 ian mc posted:
How do i set the initial values in my forms to disapear on click, so users don't have to delete the initial value first before they type ?

Dooks

Replies

Replied 14 Jun 2004 23:39:07
14 Jun 2004 23:39:07 Dave Thomas replied:
you call the onFocus event.

this little snippet will remove the default text onFocus and put it back in if your visitor doesnt enter anything onBlur.

<pre id=code><font face=courier size=2 id=code>&lt;input type="text" name="text1" onfocus="if(this.value=='Your Text')this.value='';" onblur="if(this.value=='')this.value='Your Text';" value="Your Text"&gt;</font id=code></pre id=code>

Regards,
Dave

<img src="www.nova-cs.co.uk/DmxAvatar.jpg" border="0">

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
Replied 15 Jun 2004 00:54:28
15 Jun 2004 00:54:28 ian mc replied:
Superb ! Cheers Dave. Exactly what i was looking for. Many thanks,

Dooks.

Reply to this topic