Can't seem to get comment_form(); to play nicely
-
Hi there,
I am trying to modify the default comment form by using comment_form($args); – my problem is that some of the fields respond while others stay completely unaffected.
This is what my code looks like:
<?php $fields = array( 'comment_notes_after' => '', 'author' => '<p class="comment-form-author">' . '<input class="text" id="author" name="author" type="text" value="Name *" size="30" onfocus="if(this.value==\'Name *\') this.value=\'\';this.style.color=\'#FFF\';" onblur="if(this.value==\'\') this.value=\'Name *\';this.style.color=\'#00AEEF\';"' . $aria_req . ' /></p>', 'email' => '<p class="comment-form-email">' . '<input id="email" name="email" type="text" value="Email *" size="30" onfocus="if(this.value==\'Email *\') this.value=\'\';this.style.color=\'#FFF\';" onblur="if(this.value==\'\') this.value=\'Email *\';this.style.color=\'#00AEEF\';"' . $aria_req . ' /></p>', 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label>' . '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>', 'comment_field' => '<p class="comment-form-comment"><!--<label for="comment">' . _x( 'Comment', 'noun' ) . '</label>--><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" onfocus="if(this.value==\'Comment\') this.value=\'\';this.style.color=\'#FFF\';" onblur="if(this.value==\'\') this.value=\'Comment\'" ' . $aria_req . '>Comment</textarea></p>', ); comment_form($fields); ?>
The comment_field value works as well as comment_notes_after but everything else seems to get ignored.
If I change
comment_form($fields);
tocomment_form(array('fields'=>$fields));
then the two fields that are currently working break and the others work. This method also creates two textareas for the actual comment.I’d greatly appreciate any help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Can't seem to get comment_form(); to play nicely’ is closed to new replies.