## Contact form 7 Dynamic text – placeholder on GET field

Question

I am using Contact form 7, with the Dynamic Text plugin. This works really nicely…

What I’m doing is setting it up so that if the user clicks on a link on a product, it redirects them to an enquiry form, with the product name already input into a field…

This works fine, using the following CF7 code:

<p>[dynamictext enquiry-product "CF7_GET key='product-name'" ]</p>


and then navigating to the enquiry form by:

http://www.myurl.com/contact-form/?product-name=Product%20Name


However, I’m trying to work out how to extend the shortcode so that I can include both a placeholder (sometimes people will visit the form NOT from the product page) AND also add some text before…

So the field would say:

“Enquiry about Product Name” (with ‘Product Name’ pulling in from the URL).

and if they just goto the form from http://www.myurl.com/contact-form the field would just have a placeholder of “Enquiry subject”.

I’ve tried:

<p>[dynamictext enquiry-product "CF7_GET key='product-name'" placeholder "Enquiry Subject"]</p>


I’ve also tried:

<p>[dynamictext enquiry-product "Enquiry About CF7_GET key='product-name'"]</p>


and

<p>[dynamictext enquiry-product "Enquiry About "CF7_GET key='product-name'""]</p>


No luck…

Anyone know if this is possible even? If not, any alternative options to pass the product name into the field, whilst also being able to add to the text and have a placeholder.

Thanks!

0
2 years 2020-10-22T10:10:28-05:00 0 Answers 14 views 0