Comment_Form
-
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
- The topic ‘Comment_Form’ is closed to new replies.