Title: Comment_Form
Last modified: May 4, 2017

---

# Comment_Form

 *  [tascam424](https://wordpress.org/support/users/tascam424/)
 * (@tascam424)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/comment_form-3/)
 * Hi folks i’m customising the comment_form and i have a little issue. I’ve created
   a little effect on the label using <span> as you can see in the code below.
 * When the field is clicked on to enter the name etc, the span class changes to
   active and moves the placeholder.
 * However when signed in the the default users values automatically appear but 
   don’t activate the active state.
 * Any suggestions on how to address this would be great thanks.
 * `'author' => '<div class="col-md-6"><div class="input-contact"><input id="author"
   name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ).'"
   size="30" required /><span>' . esc_html__( 'Name', 'matrix' ) . '</span></div
   ></div>'`
 * And my js
 *     ```
       $(".input-contact input, .textarea-contact textarea").focus(function () {
               $(this).next("span").addClass("active");
           });
           $(".input-contact input, .textarea-contact textarea").blur(function () {
               if ($(this).val() === "") {
                   $(this).next("span").removeClass("active");
               }
           });
       ```
   
 * Thanks again

Viewing 1 replies (of 1 total)

 *  [codismo](https://wordpress.org/support/users/codismo/)
 * (@codismo)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/comment_form-3/#post-9104113)
 * Try this:
 *     ```
       $('.input-contact input, .textarea-contact textarea').each(function(){
   
       	if ( $(this).val() == '' ) {
       		 $(this).next('span').removeClass('active');
       	} else {
       		$(this).next('span').addClass('active');
       	}
   
       });
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Comment_Form’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [codismo](https://wordpress.org/support/users/codismo/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/comment_form-3/#post-9104113)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
