Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Static term for search box

Quote Reply
Static term for search box
How do we create a static term for the search box?

Porn movies search engine
http://www.herculinks.com

Adult directory, search and TGP
http://www.herculesporn.com

Last edited by:

Herculinks: Sep 1, 2009, 11:38 AM
Quote Reply
Re: [Herculinks] Static term for search box In reply to
You mean like /search/somethigng , and that goes to search.cgi?query=something

?

You can't do it for "box" (well, you could - with some JS probably, but not got time to play around with that =))

Doing it just as a link its pretty simple with a rewrite rule. Something like:

Code:
RewriteRule ^search/(.*) /cgi-bin/search.cgi?query=$1 [L]

..but that will only partly work (for example, the span pages etc won't have the same thing).

I've done it before - where it coverts like that - and even works with span pages - but its long winded to do, and pretty complex.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static term for search box In reply to
Okay, so how do we create preset words in the search box area?

For example, all viewers see the preset words "enter your search term" in the search box area.

Porn movies search engine
http://www.herculinks.com

Adult directory, search and TGP
http://www.herculesporn.com
Quote Reply
Re: [Herculinks] Static term for search box In reply to
Oh, thats simple. Just put something like this:

Code:
value="<%if query%><%else%>Please enter your query<%endif%>"

You could even go as far as something like this on the input gox too:

Code:
onfocus="this.value='';"

..or even more:

Code:
onfocus="if (this.value == 'Please enter your query') { this.value = '' }

This would then remove the content, when they click on it (unless the content is different to "Please enter your query)

All untested, but should work.

UPDATE - just tried this, and works perfecto =)

Code:
<input type="text" name="query" size="20" value="<%if query%><%query%><%else%>Please enter your query<%endif%>" onfocus="if (this.value == 'Please enter your query') { this.value = '' }" />

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!