WordPress.org

Forums

searchform.php hijacking comment.php? (2 posts)

  1. novice21
    Member
    Posted 7 years ago #

    Everytime I try to add a comment to my post I end up with a 'no search results found page.'

    I know exactly whats causing the problem but I don't know how to fix it! My problem comes from not having a search button in my searchform.. this is what searchform.php looks like:

    <form method="get" id="search_form" action="<?php bloginfo('home'); ?>" />
    	<input name="s" type="text" class="search_input" id="s" onfocus="if (this.value == 'search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'search';}" value="Search" />
    	<input type="hidden" id="searchsubmit" value="Search" />

    Something in there ia conflicting with my comment.php because when I remove the code everything works fine and I can submit comments. My comment.php page is untouched so it has the default code.

    Any ideas?

  2. novice21
    Member
    Posted 7 years ago #

    I think I just fixed it... I changed my form code so that it still doesn't have a button and yet comment.php works.

    <form method="get" id="searchform" action="<?php //bloginfo('home'); ?>/">
    <div><input type="text" value="<?php //the_search_query(); ?>" name="s" id="s" />
    <input type="hidden" id="searchsubmit" value="Search" />
    </div>
    </form>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags