PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Encode part of form submission

  1. Hi,

    Is it possible to encode part of the submission from a form?

    I need to send data to another website which includes a return URL that needs to pass the form data back to the site. At the moment the variables are being correctly passed to the other site (thanks to Carl's help) but I haven't found a way to bring the data back.

    Any help would be appreciated.

    Many thanks,

    James

    Posted 10 years ago on Tuesday October 20, 2009 | Permalink
  2. What are you bringing the data back to?

    If I remember the site you were passing data to wouldn't allow you to pass data back via a querystring in the return url.

    Posted 10 years ago on Tuesday October 20, 2009 | Permalink
  3. James,
    Have you tried entering your return url encoded? So that your query string would look something like this:
    email={Email:1}&para2={Variable:2}&returnUrl=http%3A%2F%2Fmydomain.com%3Femail%3D%7B{Email:1}%7D%26para2%3D%7B{Variable:2}%7D

    If this doesn't do the trick, you can still use the gform_post_submission hook to manually redirect users to the confirmation page, but you will need to write some PHP to do that. There is a code snippet on the help page of the plugin and in the documentation pages of this site that will help you get started.

    Good Luck.

    Posted 10 years ago on Tuesday October 20, 2009 | Permalink
  4. Thanks for the quick and helpful replies!

    I have updated the query to encode the characters as per your example which works well.

    All the data is being passed correctly to the register form (wp-login.php?action=register) and everythng auto populates except the requested username and email address...

    example: http://mysecretvault.co.uk/pet-awards-wp/wp-login.php?action=register&user_login=alexparsons&firstname=Alex&lastname=Parsons&user_email=alex@parsons.com&gender=Female&address=123%20Fake%20Street%20%20&city=Bobtown&state=WA&zip=98765&phone_number=098765556778&date_of_birth=1991-03-05&regcode=447233273928846

    Any ideas why the username and email address are left out?

    Is there a way to force this form to auto submit so the user doesn't have to click register?

    I know this is beyond the scope of this support forum and I'm really grateful for any help you can provide.

    Many thanks,
    James

    Posted 10 years ago on Wednesday October 21, 2009 | Permalink
  5. d4le
    Member

    I noticed those two fields have class="input", none of the other fields do. JQuery might be zapping them, try changing the class, or putting "input" as the class for another field, and see if they don't get populated.

    Posted 10 years ago on Wednesday November 18, 2009 | Permalink