Forums

What is wrong with this sidebar searchform??? (4 posts)

  1. Ninja Master Jimmy Wong-Fu
    Member
    Posted 1 year ago #

    I would like to add a search form manually (not through the dynamic searchbar function)

    To do this I have the following code in the sidebar to call the search form:

    • <div id="searchform" style="margin:10px 0px;>
      <?php get_search_form(); ?>
      </div>
  2. And here is the search form:

    <form method="get">
    <form method="get" class="searchform" action="<?php bloginfo('url'); ?>/">
    <table class="searchform" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="searchfield">
    <input type="text" class="searchtext" value="<?php the_search_query(); ?>" name="s" />
    </td>
    <td class="searchsubmit">
    <input class="submit" name="submit" value="Search" type="image" src="<?php echo get_bloginfo('template_directory'); ?>" />
    </td>
    </tr></table>
    </form>

    The only way I can get this working is if I add an extra <form method="get"> before the existing one.?! Without it the search function does not work.

    Please help if you know why this is happening.

    Jimmy Wong-Fu

  • Agus Suhanto
    Member
    Posted 1 year ago #

    I think you could see the resulting HTML, is there two form tag instead of one? It's should only need one to work.

  • Ninja Master Jimmy Wong-Fu
    Member
    Posted 1 year ago #

    I am using the modified kubrick theme, but even when I strip the sidebar of all dynamic coding I still get the same result: the searchform can be seen but no searches can be made without duplicating <form method="get">???

    A mystery...

  • MAS
    Member
    Posted 1 year ago #

    <form method="get" class="searchform" action="<?php bloginfo('url'); ?>/">
    <table class="searchform" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="searchfield">
    <input type="text" class="searchtext" value="<?php the_search_query(); ?>" name="s" />
    </td>
    <td class="searchsubmit">
    <input class="submit" name="submit" value="Search" type="image" src="<?php bloginfo('template_directory'); ?>/images/search.jpg" />
    </td>
    </tr></table>
    </form>

    Try this. Put appropriate image path for search button.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags