Jump to content

Add Form Field To Submit Redirect URL

Go to solution Solved by creedon,

Recommended Posts

Is it possible to add a form's email field value to the query string parameter on the form submission redirect URL?

For example:  If the form has an email field,  I want the form submission redirect URL to be: 
https://example.com/?email=test@example.com

I would image, if it's possible, it would be formatted something like this:  
https://example.com/?email={{EmailFieldName}}

Is this possible?

Thanks!

Edited by mrwill
Link to comment
  • 4 months later...
1 hour ago, bryansinger said:

The redirect url changes the "@" to "%40" ...any idea how to make it clean.

The URL is being properly encoded per URL specs.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 3/23/2022 at 7:38 AM, bryansinger said:

Trying to redirect to Calendly auto-fill and they are after the "@" version, as opposed to "%40".  If there's a workaround

I have updated my cited code in my November 17, 2021 post earlier in this thread.

There is a new flag to control if the email is encoded or not.

Let us know how it goes.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 4 weeks later...
2 hours ago, wanderingjam said:

Have added link to .js file and added code to specific page.

Would love some help!  Thanks!

You discovered a bug in my twcsl code! Thank you.

I believe I have corrected the issue.

Please reinstall twcsl per the instructions, making sure to download the new version, and let me know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
5 minutes ago, wanderingjam said:

@creedon One more question for you:

If I want to change the URL parameter variable name from Email to SQF_EMAIL, where would I need to make that change?  i.e. I want it to pass through as redirecturl.com/redirectpage?SQF_EMAIL=<email address>

Thanks!

Line 39 just needed to set label variable to my own value.

 

Thanks for this!

Link to comment
Just now, wanderingjam said:

Line 39 just needed to set label variable to my own value.

Sounds like I should make that a user settable option in the next version of my code! 🙂

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 7 months later...

@creedon back for more here.  Trying to tweak your code to work for form fields other than email.  Specifically, I have a hidden field whose value I'd like to pass as a parameter on redirect.  The hidden field does have a name, so I assumed I would just change the value from .email to .<hidden field name> however I'm not able to get it to work as hoped.

P.S. I had also looked at passing a text field in my form but found that those fields do not have a name attribute, only an id.  Perhaps there's a tweak to make where I can use ID to identify the field I'd like to pass?

Thanks!

Link to comment
3 hours ago, wanderingjam said:

Trying to tweak your code to work for form fields other than email.

I don't think tweaking is going to do it. The code was designed for its specific purpose without thought for generalization.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 4 months later...

Just try it now, but it doesn't seem to be working. 

I have installed the js file and added the code to the page header. 

 

Getting this error on page load:

Refused to execute script from 'https://www.qweebi.com/s/twcsl.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

 

Edited by abhiQweebi
Link to comment
13 hours ago, abhiQweebi said:

Just try it now, but it doesn't seem to be working.

Please post the URL for a page on your site where we can see your issue.

A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 4/16/2023 at 2:29 AM, creedon said:

Please post the URL for a page on your site where we can see your issue.

A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

https://www.qweebi.com/stemcon/book-a-meeting

 

Check this page. This page redirects to calendly on submission. I was hoping to pre-fill the name and email fields on calendly. 

Link to comment
18 hours ago, abhiQweebi said:

Check this page.

twcsl is not installed properly.

ScreenShot2023-04-17at2_30_06PM.png.76ffcab44ce3bc9d81caec59279ee84d.png

Please review steps 1 & 2 of the Paid Plan Install Steps for twcsl.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 4/18/2023 at 5:36 AM, creedon said:

twcsl is not installed properly.

ScreenShot2023-04-17at2_30_06PM.png.76ffcab44ce3bc9d81caec59279ee84d.png

Please review steps 1 & 2 of the Paid Plan Install Steps for twcsl.

ohh yes! You were right. Quiet new to this so still figuring stuff out. 

Rediret works with the email now but having this encoding issue now:
 

Trying to redirect to Calendly auto-fill and they are after the "@" version, as opposed to "%40". 

I tried setting the const encode = false but same result. 

Is it possible to add another field form the form to to the URL parameters?

 

Really appreciate the help! 

 
Link to comment
On 4/19/2023 at 5:06 AM, abhiQweebi said:

Rediret works with the email now but having this encoding issue now:
 

Trying to redirect to Calendly auto-fill and they are after the "@" version, as opposed to "%40". 

I tried setting the const encode = false but same result. 

You need to make two changes.

      const nth = "#block-11f0ac363ae2a6dc85ee"; // which form block from the page to use
      
      // false or true, set to false to not encode the email parameter
      
      const encode = true;
      

The code should look like the following.

      const nth = 1; // which form block from the page to use
      
      // false or true, set to false to not encode the email parameter
      
      const encode = false;
      

 

Quote

Is it possible to add another field form the form to to the URL parameters?

The code does not currently do this. I'll cogitate on how the code might be reworked to use multiple fields. Keep your eyes on this this thread. I can't make any promises that I can come up with something. If I do it would be at least several days, sometime into next week. 

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.