• Resolved intricateartist

    (@intricateartist)


    I am working on a design and I’ve never experienced this kind of behavior before. On the comments form, when you hit “submit comment”, you get search results. It’s like the wp-comments-post form action isn’t there – but it is.

    Here’s the comment form:

    <?php if ( comments_open() ) : ?>
    <h3><?php _e('Leave a comment'); ?></h3>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a></p>
    
    <?php else : ?>
    
    <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="40" tabindex="1" />
    <label for="author"><small>Name</small></label></p>
    
    <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" />
    <label for="email"><small>Mail (required, will not be published)</small></label></p>
    
    <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="40" tabindex="3" />
    <label for="url"><small>URL</small></label></p>
    
    <?php endif; ?>
    
    <p><?php do_action('comment_toolbar', 'comment'); ?></p>
    
    <p><textarea name="comment" id="comment" cols="45" rows="10" tabindex="4"></textarea></p>
    
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>

    Does anyone have any idea why this might be occuring? The resulting URL looks like this:

    ?s=search+entries&comment=trying+again.&submit=Submit+Comment&comment_post_ID=44&_wp_unfiltered_html_comment=3a4079a5f0

    I do have a .search class in my CSS, a searchform.php and search results php. I do not have a .submit class.

    I have applied the default comment form to the theme and it behaves the same way.

    Suggestions would be greatly appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter intricateartist

    (@intricateartist)

    After removing the searchform.php, that is what is conflicting with the comments form submit.

    I’d love to know how to revise the searchform so that it doesn’t behave this way – here’s the code:

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

    (@intricateartist)

    got it. nevermind. if anyone else has this issue, here are the searchform revisions:

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

    I am having a related problem I think. When I hit the “submit comments” button, the window for subscribing to my feedburner email subscription pops up! I am not sure how to approach debugging this… can anyone help?

    My site is http://www.bitesizebio.com

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Submit Comment = Search Results?’ is closed to new replies.