X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Type the word to search (https://forum.x-cart.com/showthread.php?t=21618)

NightFire 05-07-2006 03:10 AM

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()">


balinor 05-07-2006 04:22 AM

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..." />

NightFire 05-07-2006 04:24 AM

Thanks balinor. Works great.
Its also working with 2 languages by using a language variable 8)

jwilkers 09-19-2007 05:57 PM

Re: Type the word to search
 
seems logical, but on mine, the prefill text does not disappear when the search box is clicked

balinor 09-19-2007 06:07 PM

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=''" />


All times are GMT -8. The time now is 01:23 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.