WordPress.org

Ready to get started?Download WordPress

Forums

Comments: Name value default issue (3 posts)

  1. mikelllr
    Member
    Posted 1 year ago #

    The Name field for someone posting a comment is pre-populated in Chrome with 'somebody', in Firefox with 'Harry, and in IE with just a blank, which is how I want it.

    Looking at the field via Chrome Inspector it show that the value attribute is pre-populating this field in: <p class="comment-form-author"><input id="author" name="author" type="text" value="somebody" size="30" tabindex="1"><label for="author">Name</label> </p>

    If I change value="somebody" to value="" in Chrome Inspector, it displays without the 'somebody'.

    How do I make this change permanent in WordPress so thatsomeone posting a comment can just fill in their name in a non-pre-populated field for all browsers?

    Thanks for help or ideas.

  2. deepbevel
    Member
    Posted 1 year ago #

    Look in your theme files for comments.php, the value should be there.

  3. mikelllr
    Member
    Posted 1 year ago #

    Thanks, deepbevel but comments.php is a core Genesis Framework file and is not supposed to be edited under any circumstances, all editing is to be done in the child theme (which has no comments.php file). Additionally, searching the two comments.php files test in Genesis Framework finds no value="somebody" anywhere in the code. I believe the relevant section is:

    $author = '<p class="comment-form-author">' .
    	          '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' />' .
    	          '<label for="author">' . __( 'Name', 'genesis' ) . '</label> ' .
    	          ( $req ? '<span class="required">*</span>' : '' ) .
    	          '</p><!-- #form-section-author .form-section -->';

    Here's what it looks like on my site: http://www.alltruenews.com/politics-test-post-2
    Scroll down to immediately below: "What Do You Think? - The World Wants to Hear From You!"

Topic Closed

This topic has been closed to new replies.

About this Topic