cancel
Showing results for 
Search instead for 
Did you mean: 

Hint/Tooltip for the SearchForm

Hint/Tooltip for the SearchForm

Does anyone have a tooltip or hint css/ajax/ code for this? Ideally to show that product codes would be entered without spaces between characters ie JY0110 and not JY 0110?

 

It would have to be included in the form code here:

 

<form id="search_mini_form" action="https://www.citizenshop.co.uk/index.php/catalogsearch/result/" method="get">
  <div class="form-search">
    <input id="search" type="text" name="q" value="" class="input-text" />
    <button id="go" type="submit" title="Search" class="button"></button>
    <div id="search_autocomplete" class="search-autocomplete"></div>
    <script type="text/javascript">
        //<![CDATA[
            var searchForm = new Varien.searchForm('search_mini_form', 'search', 'Search Our Watches');
            searchForm.initAutocomplete('https://www.ourdomain/index.php/catalogsearch/ajax/suggest/', 'search_autocomplete');
        //]]>
        </script> 
  </div>
</form>

ANY help will be ideal and much appreciated, wearing the coders hat on top of managing the business is proving a hard task in this office lol

 

3 REPLIES 3

Re: Hint/Tooltip for the SearchForm

Hello CitizenPayne,

 

When customers find a product name, for example: they enter name of product with many spaces, what happens?

We must custom Magento Search. Magento is not easy for us. So, we should choose an easy way. I think we can use javascript regex if your product codes has patterns.

 

For example: your product code has a pattern like JYI*******

 

=> Javascript regex: ^JYI((?!\s).)*$ => three letters tell our code that there is a product code here.

 

You can test regex Javascript here

Problem solved? Click Accept as Solution!

Re: Hint/Tooltip for the SearchForm

Thanks for the reply but if you read my question you will see that all I want is a tooltip on the search field smh

Re: Hint/Tooltip for the SearchForm

Hello CitizenPayne,

 

You try with this: http://stackoverflow.com/questions/13116972/how-do-i-display-a-hint-box-or-tooltip-while-the-user-is...

 

Or jQuery library for tooltip: http://jquerytools.github.io/demos/

Problem solved? Click Accept as Solution!