We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum


Thread tagged as: Question, Blog, Forms

Calling a contact form from within a blog post

I want a user to be able to contact me about a blog item they are viewing.

I assume I should use a contact form to capture the user's contact details and prefil the blog item details.

How do I pass the variables captured in the blog post.html template to a page other than post.php?

cow shed

cow shed 0 points

  • 3 years ago

I'm no guru when it comes to stuff like this but here's my 2p's worth...

If you put this in your post.html template file, or create a new template and add it into your post.php file would this work?

<perch:form id="blogform" method="post" app="perch_forms"> <div style="display:none;"> <perch:input type="text" id="blog" label="Blog Post" value="<perch:blog id="postTitle" />" /> </div> <perch:input type="email" id="email" required="false" label="Email" placeholder="Email Address" class="email" /> <perch:input type="textarea" id="message" label="Message" placeholder="Message..." /> <perch:input type="submit" id="submit" value="Send Message" /> <perch:success> Thank you </perch:success> </perch:form>

All the contact info would be under the same form, but using the hidden field with the blog post title value you'd at least know which blog the contact came from.

Sorry can't test it as i'm on a train, but i must be somewhere in the ball park?

Thanks so much - thats brilliant - it does just what I want it to.

Your welcome, glad it worked