• ninja-master-jimmy-wong-fu

    (@ninja-master-jimmy-wong-fu)


    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>

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think you could see the resulting HTML, is there two form tag instead of one? It’s should only need one to work.

    Thread Starter ninja-master-jimmy-wong-fu

    (@ninja-master-jimmy-wong-fu)

    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…

    <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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What is wrong with this sidebar searchform???’ is closed to new replies.