Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search Box


Bobbot20

Recommended Posts

this should be it, but you have to edit it in a form tag

 

form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
                              'align' => 'center',
                              'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

 

tom

Link to comment
Share on other sites

try pasting just this:

 

tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'

 

you could remove BOX_SEARCH_ADVANCED_SEARCH . '</b> for no advanced search link

 

haven't tried it

 

tom

Link to comment
Share on other sites

I have it working, but it looks weird.

 

I am adding a search box to the top of each of my pages, but it looks weird. It looks ok if you use a standard grey boring submit button. But if i use a custom image, it doesnt line them up.

 

 

 

The php code

 

<?php

 

$hide = tep_hide_session_id();

 

echo '<form name="quick_find" method="get" action="' . tep_href_link (FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">';

 

echo $hide . '<input type="text" name="keywords" size="15" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . '' ;

 

echo tep_image_submit('button_quick_find.jpg', BOX_HEADING_SEARCH);

 

echo '</form>';

 

?>

 

 

 

The HTML it outputs

 

<form name="quick_find" method="get"

 

action="http://www.myurl.co.uk/advanced_search_result.php">

 

<input type="text" name="keywords" size="15" maxlength="30" value=""> <input type="image" src="button_quick_find.jpg"

 

border="0" alt="Quick Find" title=" Quick Find "></form>

 

 

 

The finished result, note the unalignment.

 

searchbox.jpg

 

 

 

Any ideas how I can fix this, so the box and button line up? I suppose I could use a text link, but this would mean using javascript.

Link to comment
Share on other sites

I have it working, but it looks weird.

 

I am adding a search box to the top of each of my pages, but it looks weird. It looks ok if you use a standard grey boring submit button. But if i use a custom image, it doesnt line them up.

 

 

 

The php code

 

 <?php 

$hide = tep_hide_session_id(); 

echo '<form name="quick_find" method="get" action="' . tep_href_link (FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">'; 

echo $hide . '<input type="text" name="keywords" size="15" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . '' ; 

echo tep_image_submit('button_quick_find.jpg', BOX_HEADING_SEARCH);

echo '</form>'; 

?> 

 

 

 

The HTML it outputs

 

<form name="quick_find" method="get" 

action="http://www.myurl.co.uk/advanced_search_result.php">

<input type="text" name="keywords" size="15" maxlength="30" value=""> <input type="image" src="button_quick_find.jpg" 

border="0" alt="Quick Find" title=" Quick Find "></form>

 

 

 

The finished result, note the unalignment.

 

searchbox.jpg

 

 

 

Any ideas how I can fix this, so the box and button line up? I suppose I could use a text link, but this would mean using javascript.

Link to comment
Share on other sites

I have it working, but it looks weird.

 

I am adding a search box to the top of each of my pages, but it looks weird. It looks ok if you use a standard grey boring submit button. But if i use a custom image, it doesnt line them up.

 

 

 

The php code

 

<?php

 

$hide = tep_hide_session_id();

 

echo '<form name="quick_find" method="get" action="' . tep_href_link (FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">';

 

echo $hide . '<input type="text" name="keywords" size="15" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . '' ;

 

echo tep_image_submit('button_quick_find.jpg', BOX_HEADING_SEARCH);

 

echo '</form>';

 

?>

 

 

 

The HTML it outputs

 

<form name="quick_find" method="get"

 

action="http://www.myurl.co.uk/advanced_search_result.php">

 

<input type="text" name="keywords" size="15" maxlength="30" value=""> <input type="image" src="button_quick_find.jpg"

 

border="0" alt="Quick Find" title=" Quick Find "></form>

 

 

 

The finished result, note the unalignment.

 

searchbox.jpg

 

 

 

Any ideas how I can fix this, so the box and button line up? I suppose I could use a text link, but this would mean using javascript.

Link to comment
Share on other sites

Sorry for the multiple posts, I kept getting page not found error, and the ability to delete posts is not available for some reason!

 

Can a mod delete my extra posts please.

 

thnx

Link to comment
Share on other sites

I added this... BEWARE, the colors are edited to my site...

It doesnt add any funky tables or extra lines aronud it since I edited it around. Just the Search box, and the Advanced search link

 

 <?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); ?>
             </td>
             <td align="center" class="headerNavigation">
                  <table border="0" cellspacing="0" cellpadding="0">
                      <td class="headerNavigation" align="center"><?php echo ''; ?></td>
                      <td align="center"><?php echo tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 75px"') . tep_hide_session_id(); ?></td>
                      <td align="center"><?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH); ?></td>
                      <td class="headerNavigation" align="center"> <?php echo '<A href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><font color="#ffffff">Advanced Search</font></A>'; ?></td>
                     </table>
                     </form>

 

You can see it Here

 

::is WAY proud of self for getting it IN the Header bar :) ::

 

Hope that helps some!

One of these days, I will actually understand what I just changed...

 

But reading the Manual DEFINATELY helps...

Link to comment
Share on other sites

That works great, but I cant get it to fit in with my css design :(

 

Does anyone know how I can convert this to fit into a part of the design which is full CSS?

Link to comment
Share on other sites

Hey Tariq,

 

I like what you did with the search box. Where do you paste the code to get it into the header bar?

 

<?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); ?>

            </td>

            <td align="center" class="headerNavigation">

                  <table border="0" cellspacing="0" cellpadding="0">

                      <td class="headerNavigation" align="center"><?php echo ''; ?></td>

                      <td align="center"><?php echo tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 75px"') . tep_hide_session_id(); ?></td>

                      <td align="center"><?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH); ?></td>

                      <td class="headerNavigation" align="center"> <?php echo '<A href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><font color="#ffffff">Advanced Search</font></A>'; ?></td>

                    </table>

                    </form>

 

James

Link to comment
Share on other sites

Thanks Melinda,

 

I put the search box in the header bar and changed the white background to the colour of the header bar and used the white text it looks terrific.

 

cheers James

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...