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

Type the word to search

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-07-2006, 03:10 AM
  NightFire's Avatar 
NightFire NightFire is offline
 

X-Adept
  
Join Date: Jul 2004
Location: The Netherlands
Posts: 561
 

Default Type the word to search

The X-Cart searchbox is usually empty. It would be nice if there was a pre defined text in it like: type here to search. When the customer clicks on this white box with text the text will disappear and they will be able to enter their search term.

Does anybody knows how to do this?


Here is the code of the search box:

Code:
<TABLE border="0" cellpadding="0" cellspacing="0"> <FORM method="POST" action="search.php" name="productsearchform"> <INPUT type="hidden" name="simple_search" value="Y"> <INPUT type="hidden" name="mode" value="search"> <INPUT type="hidden" name="posted_data[by_title]" value="Y"> <INPUT type="hidden" name="posted_data[by_shortdescr]" value="Y"> <INPUT type="hidden" name="posted_data[by_fulldescr]" value="Y"> <TR> <TD valign="middle"> <INPUT type="text" name="posted_data[substring]" size="16" value="{$search_prefilled.substring|escape}"> </TD> </TR> </FORM> </TABLE> </td> <td> <A href="javascript: document.productsearchform.submit()">
__________________
Best regards,
Niki Buitenrust Hettema

X-Cart Gold 4.1.8 (Live & Loaded)
Royal Bhaktapur: Handmade products from Nepal - Pashmina's, scarfs, shawls, stola's and more...
Reply With Quote
  #2  
Old 05-07-2006, 04:22 AM
 
balinor balinor is offline
 

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

Default

Just replace this:

<INPUT type="text" name="posted_data[substring]" size="16" value="{$search_prefilled.substring|escape}">

with this:

<INPUT type="text" name="posted_data[substring]" size="16" value="search our site..." />
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-07-2006, 04:24 AM
  NightFire's Avatar 
NightFire NightFire is offline
 

X-Adept
  
Join Date: Jul 2004
Location: The Netherlands
Posts: 561
 

Default

Thanks balinor. Works great.
Its also working with 2 languages by using a language variable
__________________
Best regards,
Niki Buitenrust Hettema

X-Cart Gold 4.1.8 (Live & Loaded)
Royal Bhaktapur: Handmade products from Nepal - Pashmina's, scarfs, shawls, stola's and more...
Reply With Quote
  #4  
Old 09-19-2007, 05:57 PM
 
jwilkers jwilkers is offline
 

Advanced Member
  
Join Date: Oct 2005
Posts: 93
 

Default Re: Type the word to search

seems logical, but on mine, the prefill text does not disappear when the search box is clicked
__________________
JW - Xcart Version: several
dragged one cart's database kicking and screaming from 4.0.16 to 4.4.1.
Reply With Quote
  #5  
Old 09-19-2007, 06:07 PM
 
balinor balinor is offline
 

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

Default Re: Type the word to search

You need to use this:

<INPUT type="text" name="posted_data[substring]" size="16" value="search our site..." onFocus="this.value=''" />
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
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 02:49 PM.

   

 
X-Cart forums © 2001-2020