Forum

Thread tagged as: Forms, Members

Perch Members Forms - One-Click "request" submission

Hi, i've been playing around with Perch member forms and I've come unstuck. Essentially what I want to do is have multiple content items on a page with a "request more detail" button next to the item. On the back of clicking this button, I want Perch to send a form with prefilled member tags to the members forms (or just forms.app) that my colleague can see easily all in one list.

A quick example is :

Admin creates multiple items in a multi region page (Item A, Item B) all associated with the same Form template so a new form template doesn't have to be created every time a new item needs creating >

User/Customer Log's in to the members area >

Sees a list of items, (Item A, Item B, Item C) >

Decides she wants to know more about Item A so clicks "Register button" next to item A >

This is sent to Perch Members forms as a new form with a unique ID for "Item A" >

Admin logs in to perch sees a new form in the list called "Item A" and can see the entries next to it.

I've tried using all sorts of Content template combinations and just cannot work out how I can get this to work

HELP!!!

Gareth Phillips

Gareth Phillips 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the issue getting items into the form?

Hi Drew,

Yes that's exactly the issue. The Member Data doesn't seem to want to go into the form, i've tested a few different ways and I just can't get the forms to hold the data automatically as a "value" in each input field. I'm trying to avoid using JS to print it in as there are likely to multiple forms on the same page for different "Items" that people want to register for.

Does that make sense?

Gareth

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you have a field with e.g. id="foo" any data you send in with PerchSystem::set_var('foo', 'bar') should populate the field.

so I'd have to create hidden fields with the member data that's populated on the page load and then code it with PHP to send that data to the fields in question?

I thought it could have been more simple and cleaner than that with a simple member tag like follows:

<perch:input type="text" id="name" required="true" label="Name" value="<perch:member id="first_name" />" />

Also just to point out, that i'm not a PHP expert so the "PerchSystem::set_var('foo', 'bar')" doesn't mean a huge amount to me at present so any further guidance with how that would work is greatly appreciated

Drew McLellan

Drew McLellan 2638 points
Perch Support

Funnily enough i've been looking at this page whilst awaiting your response and tried it out. I thought I was on to a winner but still can't get my head around it. Have you ever seen anybody pull member data automatically in to a form before via the forum tickets? I'm really struggling to grasp it!

I get the creation of the variable bit, but I don't get how to make the ".perch_member_get('first_name')" go into the Value field of the input tag in a perch:form template

Drew McLellan

Drew McLellan 2638 points
Perch Support

Try

PerchSystem::set_var('first_name', perch_member_get('first_name', true));