Skip to content
Advertisement

Contact form 7 set field value with get request

I want to set a field value with get request

example.com/subscribe/?email=asfafs

but when i load the page which has the form on it, the form does not show. I get why it could not be showing. Because the form itself could submit a get request as well. I also installed this plugin which should enable me to set a field value, but it does not.

this is what i have:

JavaScript

In my page:

JavaScript

I wouldn’t mind using a different plugin for this. If there is one which suits my needs please tell me.

Advertisement

Answer

I just installed the plugin you linked and tested it. The plugin isn’t meant to pull in a GET variable for a field within Contact Form 7. The plugin will do two things

  1. It will grab the $_GET variable and create a hidden field with it.
  2. It will show the variable on the page (just as text, not in a field)

The shortcode that you have in your example is for use by this http://wordpress.org/plugins/contact-form-7-dynamic-text-extension/ plugin. I downloaded and tested that plugin as well, and it seems to work just fine.

Here is the page I created the example on. http://jtwebb.com/stackoverflow-question/?someemail=asdf if you want to take a look to see it is working with the dynamic-text-extension plugin.

UPDATE: This is my contact form 7 code:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement