Forums

Initial values in comments (1 post)

  1. bigfootnrg
    Member
    Posted 4 years ago #

    I'm trying to make is so some initial text shows up in the comment boxes if the visitor has not been to the sight yet.

    I tried the code below in the comments.php file, but it didn't work. I don't know too much about php, I could be going about it wrong.

    Any ideas?

    Thanks, Nathan

    <?php if ( $comment_author ) : ?>
    	<input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
    <?php else : ?>
    	<input type="text" name="author" id="author" class="textarea" value="John Doe" size="28" tabindex="1" />
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic