• I’m using Contact Form 7 integrated with MailChimp for WordPress so I can subscribe people to my MailChimp list directly from my CF7 forms.

    What I want to do is create a hidden field in the CF7 form and fill this with the URL of the current page, so it sends this URL to MailChimp.

    Something like this:

    <input type="hidden" name="mc4wp-SIGNUP_URL" value="XXXXX" />

    So I want to know if there is anything I can put for “XXXXX” in the CF7 form that will capture the URL of the current page in this field?

    CF7 has the special mail tag “[_post_url]”, which will put the page URL in the email I receive from the user. But as far as I can see, this mail tag can’t be used in the form itself.

    Is there a way I can fill the current page URL in the field – either using the special mail tag or something else?

    Thanks in advance for your help ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • just make another field and use js to copy value from _post_url field into the one you can pass to mailchimp. You can put the js code inside the form editor or use add_action();

    Thread Starter NW1

    (@nw1)

    Hi Paul, many thanks for your response. Unfortunately I don’t know anything about javascript – are you able to give me a code snippet that would do this? Or can you point me in the right direction for some resources that would help me to figure out how to do it? Thanks again ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fill input field with page URL’ is closed to new replies.