Forum Moderators: open

Message Too Old, No Replies

Search Form on focus Problem

It either doesn't validat or doesn't work.

         

Lorel

9:28 pm on Dec 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a search form set up that is supposed have the text inside the box disappear when someone starts typing inside the box. I've seen two sets of instructions for this:

onFocus=value="" <--this works but doesn't validate

onFocus="doClear(this)" <--this doesn't work.

I have included the code for whole search box below however this is the line that I need to figure out how to validate.

<input type="text" name="Search" value="Keyword or Part #" onFocus=value="">

Any suggestions?

------complete code-----

<form name="search" method="post" action= "http://HOSTDOMAIN.COM">
<input type="hidden" name="Store_Code" value="SITE INITIALS">
<input type="hidden" name="Screen" value="SRCH"> <input type="text" name="Search" value="Keyword or Part #" onFocus=value="">
<input type="image" src="images/search.gif" alt="search" class="textmiddle">
</form>

coopster

10:08 pm on Dec 28, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Although you haven't specified the DOCTYPE you are attempting to validate against, this former WebmasterWorld thread may give you some insight to your issue:
[webmasterworld.com...]

Lorel

12:42 am on Dec 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks.

I only needed to put Action="" and it validated.