Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-23 10:37:50

hilary
Member
Registered: 2006-09-11
Posts: 37

Using an image instead of submit in search

Hi All!

Sorry to be a bother!

Im just using the txp:search_input tag to output the text field, is there any way to add an image as the submit button?
The only attribute I can find is button=“text”, I really need to swap that for an image!

Help!

Thanks!!!

Offline

#2 2007-04-23 10:43:57

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Using an image instead of submit in search

you can use this code in your page:

<form action=”/” method=“get”> <p>Recherche <input type=“text” name=“q” value=”“ size=“12” /> <input type=“submit” name=“search” value=”“ class=“loupe” /></p>
</form>

and in style use this:

.loupe
{ border: 0; background-color: transparent; background-image: url(“/images/loupe.gif”); background-repeat: no-repeat; background-position: top left; width: 15px; height: 15px; cursor: pointer; /* hand-shaped cursor */ cursor: hand; /* for IE 5.x */
}

You change the code (image and dimensions) to match your need.

Offline

#3 2007-04-23 11:01:12

hilary
Member
Registered: 2006-09-11
Posts: 37

Re: Using an image instead of submit in search

Cool!
Thanks a mill!!!!

Offline

#4 2007-05-31 15:31:29

execov
New Member
From: Belgium
Registered: 2007-05-29
Posts: 5

Re: Using an image instead of submit in search

I’ve tried this, and it works on firefox, but not on safari, in safari i get a standard searchbutton, although it has the size 20*20px I gave in the class (loupe) and i get like half of the letter “ s” in the image …

Offline

Board footer

Powered by FluxBB