Title: Comment form submit button not working
Last modified: August 21, 2016

---

# Comment form submit button not working

 *  [nicollette48](https://wordpress.org/support/users/nicollette48/)
 * (@nicollette48)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/comment-form-submit-button-not-working/)
 * I am creating my first custom WordPress theme and I am having trouble getting
   the comment form to work. Everything is displaying properly but when you hit 
   the submit button on the comment form, the page just refreshes and no new comment
   is submitted.
 * My site url is: nicolletteharris.com
 * Here is the comment form code in my comments.php file:
 *     ```
       <?php if(comments_open()) : ?>
       	<?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 echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p><?php else : ?>
   
       			<?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="Log out of this account">Log out &raquo;</a></p>
   
       <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
       <div class="clearfix comment-textarea">
       							<label for="comment">Comment:</label>
   
       			<textarea tabindex="4" cols="15" rows="10" id="comment" name="comment"></textarea>
   
       <input type="submit" value="Add comment" tabindex="5" id="submit" name="submit">
   
       <input type="hidden" id="comment_post_ID" value="<?php echo $id; ?>" name="comment_post_ID">
       <input type="hidden" value="0" id="comment_parent" name="comment_parent">
   
       <?php comment_id_fields(); ?>
       		<?php do_action('comment_form', $post->ID); ?>
   
       </form>
       <div class="clear"></div>
   
       <?php else : ?>
   
       <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
   
       		<div class="cf-label name-label">
       		<label for="author">Your Name: (required)</label>
       			<input type="text" aria-required="true" tabindex="1" size="21" value="<?php echo $comment_author; ?>" id="author" name="author">
   
       </div>
   
       		<div class="cf-label email-label">
       			<label for="email">E-mail (required)</label>
       							<input type="text" aria-required="true" tabindex="2" size="21" value="<?php echo $comment_author_email; ?>" id="email" name="email">
       						</div>
   
       		<div class="cf-label website-label">
       			<label for="url">Website:</label>
       			<input type="text" tabindex="3" size="21" value="<?php echo $comment_author_url; ?>" id="url" name="url">
       						</div>
   
       <div class="clearfix comment-textarea">
       							<label for="comment">Comment:</label>
   
       			<textarea tabindex="4" cols="15" rows="10" id="comment" name="comment"></textarea>
   
       </div>
   
       			<input type="submit" value="Add comment" tabindex="5" id="submit" name="submit">
       <input type="hidden" id="comment_post_ID" value="<?php echo $id; ?>" name="comment_post_ID">
       <input type="hidden" value="0" id="comment_parent" name="comment_parent">
       <?php comment_form(); ?>
       		<?php do_action('comment_form', $post->ID); ?>
       </form>
       <!-- END #comment-form -->
   
       <div class="clear"></div>
   
       <div>
       			<?php endif; ?>
   
       	<?php endif; ?>
       <?php else : ?>
       	<p>The comments are closed.</p>
       <?php endif; ?>
       ```
   
 * Please let me know what I am doing wrong. I am new to this but I have a pretty
   basic understanding of php.

The topic ‘Comment form submit button not working’ is closed to new replies.

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [form](https://wordpress.org/support/topic-tag/form/)
 * [submit](https://wordpress.org/support/topic-tag/submit/)

 * 0 replies
 * 1 participant
 * Last reply from: [nicollette48](https://wordpress.org/support/users/nicollette48/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/comment-form-submit-button-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
