Skip Navigation

[Resuelto] Auto populate Gravity Forms field using field value

This support ticket is created hace 8 años, 3 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Etiquetado: 

This topic contains 8 respuestas, has 2 mensajes.

Last updated by Adriano hace 8 años, 3 meses.

Assigned support staff: Adriano.

Autor
Mensajes
#224505

Hi there,

I have managed to get this partially working, but I am having difficulty in getting it to work 100%.

I have a View set up to display all staff members and have made their picture and name a link to open a pop-up Gravity Form using FooBox. I have a test field in Gravity Forms which is set to dynamically receive the email address via the "field_values" function. It does pull in an email address, but only the first email address in the returned results and not the email address of the staff member clicked on.

I'm not sure whether this is a Types/Views problem, or a Gravity Forms problem, but thought I should ask here first in case there was an issue with my code (see below):

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
   <wpv-loop>
     <div class="staff-member">
       <a href="#gravity_form" target="foobox" data-width="600px">[wpv-post-featured-image attr="class=image-size"]<br />[wpv-post-title]</a><br />[types field="position" id=""][/types]
       <div id="gravity_form" style="display: none;">
		<h2 class="form-title">Contact Form</h2>
	[gravityform id="1" name="Contact Form" field_values='emailing=[types field="email" output="raw"][/types]' title="false" description="false" ajax="true"]
</div>
     </div>
   </wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		[wpml-string context="wpv-views"]<strong>No staff members found in this category</strong>[/wpml-string]
	[/wpv-no-items-found]
[wpv-layout-end]

This site is currently only on my localhost dev server, but I can upload it to an online server if required.

Cheers,
Craig

#224507

I have now uploaded the site to an accessible location:

hidden link

Cheers,
Craig

#224557

Dear Craig,

Your code looks good. You will need to check with Gravity Forms support if its "[gravityform]" allow nested shortcodes, in this case [types field="email" output="raw"][/types]

#224560

Thanks Adriano,

I will give Gravity Forms Support a shout and report back once I hear from them.

Kind regards,

Craig

#224570

Dear Craig,

All right, I will let this ticket opened waiting for your confirmation.

#224860

Hi Adriano,

I got a response back from Gravity Forms, and unfortunately it seems as though they do not support nested shortcodes. Here is their reply:

---
"Hi Craig. The development team did take a look at adding support for nested shortcodes like this, but it appears that WordPress is having a bit of trouble parsing the shortcode when it's added inside an attribute,

We don't currently support nested shortcodes, but it does appear to be a useful feature. We'll add it to our list of requested features, but it's not something that we'll be able to add support for quickly. Sorry for the inconvenience."
---

That being the case, do you think there is any other way I might achieve what I am looking for within Types/Views? Basically I need to pass the 'email' field over to the form as a hidden value.

Regards,
Craig

#225202

Dear Craig,

As it is a limitation of Gravity Forms there is nothing we can do in this case. I would recommend you to try our own plugin for forms, it is CRED. It is fully compatible with nested shortcodes.

#225208

Hi Adriano,

I will give CRED a try and see if it can achieve what I am looking for. Thanks again for your help.

Kind regards,

Craig

#225211

Nice, you are welcome.