...

View Full Version : default text on external file



liccy
08-20-2008, 10:12 PM
Hi


I'm having a issue because I need to add a default text in a input field. The problem is that I know how to do it on inline stile, but no idea how to do it external...

:confused::confused::confused:

This is what I have:

<input type="text" name="myfield" value="Type Your Name" onclick="clickclear(this, 'Type Your Name')" onblur="clickrecall(this,'Type Your Name')" />


OnClick the link value should disappear only when is 'Type Your Name'

ninnypants
08-20-2008, 10:33 PM
You would set a default text for an element with JavaScript like this

document.formname.elementname.value = 'type your name';
I would also suggest changing your function that clears the text from being on click to onfocus because main user use the tab button to navigate forms or even the entire page.

<input type="text" name="myfield" value="Type Your Name" onfocus="clickclear(this, 'Type Your Name')" onblur="clickrecall(this,'Type Your Name')" />

_Aerospace_Eng_
08-20-2008, 10:36 PM
Post your clickclear and clickrecall functions.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum