Discussion:
Creating an eBay style search form...
(too old to reply)
Mark
2005-08-18 11:08:41 UTC
Permalink
Hi all

I want to recreate the search box that is at the top right of most eBay
pages.

The aspect that I am specifically talking about, is the "START NEW SEARCH"
test that is in the box by default, that disappears immediately you click in
the text box.

I have looked at the source code for the page but nothing is jumping out at
me...

Any ideas?

TIA

Mark
Philip Ronan
2005-08-18 12:24:18 UTC
Permalink
Post by Mark
Hi all
I want to recreate the search box that is at the top right of most eBay
pages.
The aspect that I am specifically talking about, is the "START NEW SEARCH"
test that is in the box by default, that disappears immediately you click in
the text box.
Is this what you mean?

<INPUT type="text" value="Search" onfocus="if
(this.value==this.defaultValue) this.value='';" onblur="if (this.value=='')
this.value=this.defaultValue;">
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Mark
2005-08-18 13:24:12 UTC
Permalink
oh yeah!!! that's the puppy

nice one Phil

you da man...
Post by Philip Ronan
Post by Mark
Hi all
I want to recreate the search box that is at the top right of most eBay
pages.
The aspect that I am specifically talking about, is the "START NEW SEARCH"
test that is in the box by default, that disappears immediately you click in
the text box.
Is this what you mean?
<INPUT type="text" value="Search" onfocus="if
(this.value==this.defaultValue) this.value='';" onblur="if
(this.value=='')
this.value=this.defaultValue;">
--
http://vzone.virgin.net/phil.ronan/
Roy Schestowitz
2005-08-19 01:34:17 UTC
Permalink
Post by Philip Ronan
Post by Mark
Hi all
I want to recreate the search box that is at the top right of most eBay
pages.
The aspect that I am specifically talking about, is the "START NEW
SEARCH" test that is in the box by default, that disappears immediately
you click in the text box.
Is this what you mean?
<INPUT type="text" value="Search" onfocus="if
(this.value==this.defaultValue) this.value='';" onblur="if
(this.value=='') this.value=this.defaultValue;">
Or this one:

<input type="text" name="q" value="&laquo; search term &raquo;"
onfocus="this.value=(this.value=='&laquo; search term &raquo;') ? '' :
this.value;"
onblur="this.value=(this.value=='') ? '&laquo; search term &raquo;' :
this.value;">

Which is essentially the same, but still...

Roy
--
Roy S. Schestowitz
http://Schestowitz.com
Toby Inkster
2005-08-18 17:37:31 UTC
Permalink
Post by Mark
The aspect that I am specifically talking about, is the "START NEW SEARCH"
test that is in the box by default, that disappears immediately you click in
the text box.
http://tobyinkster.co.uk/
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Jasen Betts
2005-08-24 13:40:12 UTC
Permalink
Post by Mark
Hi all
I want to recreate the search box that is at the top right of most eBay
pages.
The aspect that I am specifically talking about, is the "START NEW SEARCH"
test that is in the box by default, that disappears immediately you click in
the text box.
I have looked at the source code for the page but nothing is jumping out at
me...
Any ideas?
<input type="text" name="this" value="START NEW SEARCH"
onfocus="if (this.value == 'START NEW SEARCH') this.value='';" >

or something similar.

Bye.
Jasen

Loading...