Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search button not functioning correctly in search box?


beechrose

Recommended Posts

Right now, if you type a search term into the search box and hit the ENTER key, it will search and bring up search results. However, if you click on the "search" button itself instead of hitting ENTER, it takes you to the advanced search form. How can I get the form so that when I click on the button, it does what hitting the ENTER key does - bring up search results?

 

Here's the code from my current search box (I took out all text and the link to the advanced search page):

 

<!-- search //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_SEARCH);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
						   'align' => 'center',
						   'text' => '							   
					<table cellpadding="0" cellspacing="4" border="0">
						<tr><td colspan="2" style="width:100%;vertical-align:middle;">'. tep_draw_input_field('keywords', '', 'size="10" maxlength="30"  style="height:19px; width:100%;"') . '' . tep_hide_session_id() .  '</td></tr>
						<tr><td class="bg_input"><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">'.tep_image_button('button_quick_find.gif','',' style="float:right;vertical-align:middle;margin:0px 0px 0px 12px;"').'</a>' . BOX_SEARCH_TEXT . '</td></tr>
						<tr><td><span><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a></span></td></tr>
					</table>							   
					');

 new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- search_eof //-->

 

Can someone tell me what I'm doing wrong? MANY thanks in advance.

 

(Also, is there a contribution that allows the keyword search to search the product description as well as the product name an manufacturer?)

Link to comment
Share on other sites

It's doing exactly what you've told it to do :huh:

 

<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">'.tep_image_button('button_quick_find.gif','',' style="float:right;vertical-align:middle;margin:0px 0px 0px 12px;"').'</a>

 

Get your hands on a default "search box" and see the difference in your code to the default code.

Link to comment
Share on other sites

Thank you. I was using a purchased template, and by simply uploading the default search box instead of the one that came with the template, I was able to fix the error.

 

Ahh! Yes, usually template makers tend to do some strange stuff with the oscommerce code.

Glad you got it sorted.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...