Thread tagged as: Question, Blog, Members

Comments form


I've created a private blog where only members can view. I want to be able to enable comments on the posts but I want to pull the data from the member account onto the form, name etc. Is there a way to do this? comment_form.html

~~~<perch:if id="postAllowComments" value="1">

<perch:form id="comment" method="post" app="perch_blog" class="comment-form" action="<perch:blog id="postURL" />">
       <legend>Leave a comment</legend>
            <perch:label for="commentName">Name</perch:label>
            <perch:input type="text" id="commentName" required="true" label="Name" antispam="name" />
            <perch:error for="commentName" type="required">Required</perch:error>
            <perch:label for="commentEmail">Email</perch:label>
            <perch:input type="email" id="commentEmail" required="true" label="Email" antispam="email" />
            <perch:error for="commentEmail" type="required">Required</perch:error>
            <perch:error for="commentEmail" type="format">Check format of address</perch:error>
            <perch:label for="commentURL">Website</perch:label>
            <perch:input type="url" id="commentURL" placeholder="https://" label="URL" antispam="url" />
            <perch:label for="commentHTML">Comment</perch:label>
            <perch:input type="textarea" id="commentHTML" required="true" label="Message" antispam="body" />
            <perch:error for="commentHTML" type="required">Required</perch:error>
            <perch:input type="hidden" id="postID" value="<perch:blog id="postID" />" />
            <perch:input type="submit" id="submitComment" value="Submit" />

        <p>Thank you. Your comment has been submitted and will appear on the site once approved.</p>




Jade Marling

Jade Marling 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Due to the parse order, you may just be able to nest Members tags inside the value attribute of your form fields.

Give a try and let me know if that doesn't work.