Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

image in search box form field

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-14-2008, 01:51 AM
 
amcc amcc is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 73
 

Default image in search box form field

How can i put a magnifying glass image into the search box form field, so that it is either:

fixed permanently to the left; or

disappears when you put the mouse curser in the box to start typing

Cheers
__________________
X-Cart Pro 4.1.8
Reply With Quote
  #2  
Old 04-14-2008, 05:13 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: image in search box form field

can you show an example of how another site does this? I've never seen an image embedded into a text field. ever. is this even possible?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 04-14-2008, 05:58 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: image in search box form field

If you are talking about something like apple.com, that is done by using a background image.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 04-14-2008, 06:02 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: image in search box form field

Quote:
Originally Posted by balinor
If you are talking about something like apple.com, that is done by using a background image.

That's cool! How do they do that? How do they make the left side of the input box have a text margin? CSS is your friend, I guess...
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #5  
Old 04-14-2008, 06:05 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: image in search box form field

I'm guessing they just tuck an image up next to the search box, as I don't think that is part of the actual search box.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 04-14-2008, 06:05 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: image in search box form field

Quote:
Originally Posted by amcc
How can i put a magnifying glass image into the search box form field, so that it is either:

fixed permanently to the left; or

disappears when you put the mouse curser in the box to start typing

Cheers

For the text of this is done so (open file skin1/customer/search.tpl):

Find this line and change it:

PHP Code:
<td valign="middle"><input type="text" name="posted_data[substring]" size="16" value="{$search_prefilled.substring|escape}/></td

On this line:

PHP Code:
<td><input type="text" name="posted_data[substring]" onFocus="this.value = (this.value == 'Enter Keyword') ? '' : this.value;" onBlur="this.value = (this.value == '') ? 'Enter Keyword' : this.value;"   size="37" value="Enter Keyword"  /> </td
Reply With Quote
  #7  
Old 04-14-2008, 06:10 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: image in search box form field

Quote:
Originally Posted by balinor
I don't think that is part of the actual search box.

Apple is tricky.

They are using a transparent image with an "onFocus" to CHANGE the image from normal to highlighted, and the search field is within it. Very smart designer and programmer there. It's a VERY functional user interface. Uh, Duh. It's Apple. If anyone figures out exactly how they do it, please share.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #8  
Old 04-14-2008, 08:13 AM
  Jayk's Avatar 
Jayk Jayk is offline
 

eXpert
  
Join Date: Nov 2003
Location: Calgary, Alberta, Canada
Posts: 333
 

Default Re: image in search box form field

That is pretty cool. I'd like to see how to do that one too.

Jason
__________________
X-Cart Gold 4.4.3
Blog: www.flashinthepan.ca
Reply With Quote
  #9  
Old 04-14-2008, 12:05 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: image in search box form field

Here's one variation. It's called prettysearch, this ones uses the mootools framework...
http://www.conviodesign.com/2007/08/26/pretty-search/
__________________
Doms
kube v4.1.9
Reply With Quote
  #10  
Old 04-15-2008, 01:13 AM
 
amcc amcc is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 73
 

Default Re: image in search box form field

Thanks Yurij, that worked great. I found this in relation to the background image but haven't tried it out yet:

http://blog.reindel.com/2007/08/13/howto-spruce-up-your-search-box-with-css-and-a-background-image/
__________________
X-Cart Pro 4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:03 AM.

   

 
X-Cart forums © 2001-2020