Hi again,
I've been having issues with handling a successful comment post. After the form is posted successfully, I'm using <cms:if k_process_comment_success> followed by a success message, and then <cms:else/> with <cms:show k_process_comment_error />. However, only the comment error portion works. When a comment is processed successfully, I just get the rest of the form again. I followed the example fairly closely but still can't get it to work.
I've pasted my code below:
Thanks,
Sam
I've been having issues with handling a successful comment post. After the form is posted successfully, I'm using <cms:if k_process_comment_success> followed by a success message, and then <cms:else/> with <cms:show k_process_comment_error />. However, only the comment error portion works. When a comment is processed successfully, I just get the rest of the form again. I followed the example fairly closely but still can't get it to work.
I've pasted my code below:
- Code: Select all
<cms:form method="post">
<cms:if k_success >
<cms:process_comment />
<cms:if k_process_comment_success >
<h1>Hello World</h1>
<cms:else />
<div class="k_errormessage">
<p>
Could not post comment! <br>
The following error occured while processing your comment:<br>
<cms:show k_process_comment_error />
</p>
</div>
</cms:if>
<cms:else />
<cms:if k_error >
<div class="k_errormessage">
<h3>Fields incomplete!</h3>
<ul>
<cms:each k_error >
<li><cms:show item /></li>
</cms:each>
</ul>
</div>
</cms:if>
<div class="form-group">
<label for="author" class="control-label"><small>Name *</small></label>
<cms:input class="form-control" style="width:50%" type="text" name="k_author" tabindex="1" required="1" value="<cms:show k_member_title/>"/>
</div>
<div class="form-group">
<label for="link" class="control-label"><small>Website</small></label>
<cms:input class="form-control" style="width:50%" type="text" name="k_link" value="http://" size="22" tabindex="2" value="<cms:get_custom_field 'website' masterpage='members/index.php' page="<cms:show k_member_name/>"/>" />
</div>
<div class="form-group">
<label for="comment" class="control-label"><small>Comment *</small></label>
<cms:input class="form-control" type="textarea" name="k_comment" style="width:93%" rows="10" cols="10" tabindex="3"
validator_msg="required=Please enter something as comment"
required="1" />
</div>
<cms:input type="text" name="k_email" required="1" value="<cms:show k_member_email/>" style="visibility:hidden;display:none;"/>
<cms:input class="btn btn-primary btn-lg" type="submit" value="Submit" name="submit"/>
</cms:if>
</cms:form>
Thanks,
Sam