Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Location
    Brooklyn NY
    Posts
    507
    Plugin Contributions
    0

    Default How to change the search Button?

    I want to change the search button to something else but the button is in CSS can some one help with this or can it be done?

  2. #2
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: How to change the search Button

    There are 2 search boxes located in your sideboxes folder.
    There is the header search and the side box search.

    you did not say which search you wanted to change to an image.

    If you open your tpl_header_search and locate this code

    Code:
     } else {
        $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . '&nbsp;<input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />';
      }
    and change to this code:

    Code:
    } else {
        $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"').zen_image_submit(BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON,'class="input" style="position:relative;left: 0px; bottom: 4px"');}
    The button is already in your button folder.

    If you need to change the side box search let me know and I will give you the code to change that one to an images as well.

  3. #3
    Join Date
    Nov 2007
    Posts
    1
    Plugin Contributions
    0

    Default Re: How to change the search Button to a picture

    I'd like to change the search box button on the sidebox to a picture.
    Please help!

  4. #4
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: How to change the search Button

    This is the complete code that you can replace the original code with

    Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_search.php 4142 2006-08-15 04:32:54Z drbyte $
     */
      $content = "";
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
      $content .= zen_draw_form('quick_find', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
      $content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
      $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();
    
      if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
        $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br />' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
        $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
      } else {
        $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . '<br />' .zen_image_submit(BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON,'class="input" style="position:relative;left: 5px; bottom: 4px"');
        
        
        $content .= '<br />Or try &nbsp;<a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';}
    
      $content .= "</form>";
      $content .= '</div>';
    ?>
    You may need to set the position of your button and if you do in red is what needs to be changed

    class="input" style="position:relative;left: 0px; bottom: 0px

  5. #5
    Join Date
    Jul 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: How to change the search Button

    Hi, I am now almost desperate in not been able to find info on how to do the same - change the advanced search box on the sidebox to use a transparent picture like in here: http://butiche.com/ and here: http://www.impressionslast.com/. I've made the gif and on, but can't make it to show instead of the rectangular default form...
    I've asked put that on the forum here: http://www.zen-cart.com/forum/showthread.php?t=133276 but to no avail still... Please help!!!

 

 

Similar Threads

  1. v151 How to change the button width that in the INPUT element when the css button is used?
    By su35 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Jun 2013, 04:34 PM
  2. How can I make the Header Search button be a CSS button?
    By makehveli in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Aug 2011, 03:01 AM
  3. how can I expand the width of the search field amd search button?
    By watzursn in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 29 Sep 2009, 09:22 PM
  4. How do i change the size of the search button at the top?
    By lenswipe in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Jul 2009, 06:44 AM
  5. How to change 'Search Button' in sidebox?
    By billybonds in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 21 Jun 2007, 03:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR