Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

search button align


Guest

Recommended Posts

Posted

The search box button is not level with the input box so I want to add

align="absmiddle"

to the image tag for submit button.

 

how and where do i do this?

Posted

Hate to tell you this but me and a friend, who is a professional programmer, tried for ages and ages to do this, with no joy.

 

Good luck.

 

I will be interested to see if you manage it. What I did in the end is take the larger search button and put it centered underneath the input box.

Posted

Well, if I insert the search box using good ol HTML I can get it to work doing this.

 

<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); ?>
                     <td align="center"><?php echo ''; ?></td>
                     <td align="center"><?php echo tep_draw_hidden_field('search_in_description','1') .  tep_draw_hidden_field('inc_subcat', '1', true) . tep_draw_input_field('keywords','','size="10" maxlength="30" style="width: ' . (BOX_WIDTH-34) . 'px"') .  '<br>' . tep_hide_session_id(); ?></td>
                     <td align="center"><?php echo tep_image_submit('go.jpg', BOX_HEADING_SEARCH); ?></td>
      </table>

 

the problem is getting that to work with a standard box, ie getting the above to work with

 

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

 new CategoriesBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('form' => tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
                              'align' => 'center',
                              'text' => BOX_SEARCH_TEXT . '<br>' .  tep_draw_hidden_field('search_in_description','1') .  tep_draw_hidden_field('inc_subcat', '1', true) . tep_draw_input_field('keywords','','size="10" maxlength="30" style="width: ' . (BOX_WIDTH-34) . 'px"') . tep_image_submit('go.jpg', IMAGE_BUTTON_SEARCH) . '<br>' . tep_hide_session_id() . '');

 new CategoriesBox($info_box_contents);
?>
           </td>
         </tr>

 

If anyone can do that, it would be handy.

Posted

Heres a quick fix although it doesnt go all the way to fixing the problem it does bring the search button inline with the box.

 

Add this to your stylesheet.

#search {
 vertical-align: bottom;
 text-align: middle; 
 
}

 

Then in catalog/includes/boxes/search.php change line 26 (approx) so that it calls the above CSS style using a Span ID.

 

 'text' => BOX_SEARCH_TEXT . '<br><span id="search">' .  tep_draw_hidden_field('search_in_description','1') .  tep_draw_hidden_field('inc_subcat', '1', true) . tep_draw_input_field('keywords','','size="10" maxlength="30" style="width: ' . (BOX_WIDTH-34) . 'px"') . tep_image_submit('go.jpg', IMAGE_BUTTON_SEARCH) . '</span><br>' . tep_hide_session_id() . '');

Posted

OK, i got it working completely now :D

 

add the above style to your stylesheet as before.

 

Then add this line to search.php instead of the above one.

                               'text' => BOX_SEARCH_TEXT . '<br><span id="search">' .  tep_draw_hidden_field('search_in_description','1') .  tep_draw_hidden_field('inc_subcat', '1', true) . tep_draw_input_field('keywords','','size="10" maxlength="30" style="width: ' . (BOX_WIDTH-34) . 'px"') . '<span id="search">' . tep_image_submit('go.jpg', IMAGE_BUTTON_SEARCH) . '</span><br>' . tep_hide_session_id() . '');

 

All I did was move the <span> a bit further along the line, simple!

Posted

I'm impressed, you clever little bunny, you! :D :D :D

 

Still, I'm not actually going to change mine now - I rather like it with the larger button underneath.

Posted

includes/languages/english/images/buttons/button_quick_find.gif?

 

how about using any simple graphic prog and increase the height of the button with a few px on top?

"If you're working on something new, then you are necessarily an amateur."

  • 2 weeks later...
Posted
includes/languages/english/images/buttons/button_quick_find.gif?

 

how about using any simple graphic prog and  increase the height of the button with a few px on top?

 

That doesn't work but nice try.

 

Another solution you could use is using plain old HTML, and throwing it inside a table. 1 column for the input, 1 for the search, or however you want.

Posted
includes/languages/english/images/buttons/button_quick_find.gif?

 

how about using any simple graphic prog and  increase the height of the button with a few px on top?

 

That doesn't work but nice try.

 

unless i don't understand the problem (button_quick_find.gif not being nicely vertically aligned with the searchbox) it certainly works.

 

can you pls explain why in your opinion it's not working.

 

BTW: i myself use a slightly larger textbutton underneath just by inserting a <br> in the string.

"If you're working on something new, then you are necessarily an amateur."

Archived

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

×
×
  • Create New...