mmontg18 Posted March 28, 2021 Share Posted March 28, 2021 Site URL: https://northshore-village-hoa.squarespace.com/dues-form I am trying to set up a form to forward someone to a specific page after they choose a specific item from the drop down. I would like to point each option from the drop down - 1 month, 6 months, and 1 year to a different page for each one. I tried to work off of this thread -> Custom Redirect Forum Post, but am still unsuccessful. I have the code provided by @creedonin the header, but it's still not forwarding to the sites (they are random sites on my page for now, but will be the correct page in the near future). Any ideas? Thanks! Link to comment
creedon Posted March 28, 2021 Share Posted March 28, 2021 The first thing you need to do is set the POST-SUBMIT REDIRECT. The URL should be either a default page. Or in your case it sounds like there is no default as each option will go to its own page. So the redirect should be to an error page you create saying something like sorry there was an error and how to recover, start over, contact you, etc. Whatever makes sense for your situation. The code examples in that thread are very specific to the site, using references to elements that would only be on the site. The good news is that the code can be adapted to others sites. Give me a day or so to tweak the code to work for your site. mmontg18 1 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
Solution creedon Posted March 29, 2021 Solution Share Posted March 29, 2021 (edited) In the thread you cite I have updated my October 19, 2020 code post. Install that code and replace selectFormFieldName and optionUrlMappings. const selectFormFieldName = 'Length of Dues'; const optionUrlMappings = { /* the format of each line is a select field option as entered in the SS form block interface and the post-submit redirect URL for the option */ // '[enter select field option here]' : '[enter url here]', '1 Month' : '/1-month', '6 Months' : '/6-months', // last or only item doesn't get a comma at end of line '1 Year' : '/1-Year' } Let us know how it goes. Edited March 29, 2022 by creedon mmontg18 1 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
mmontg18 Posted March 29, 2021 Author Share Posted March 29, 2021 This worked perfectly! Thanks so much, @creedon! creedon 1 Link to comment
Guest Posted April 24, 2021 Share Posted April 24, 2021 On 3/28/2021 at 8:06 AM, mmontg18 said: Site URL: https://northshore-village-hoa.squarespace.com/dues-form I am trying to set up a form to forward someone to a specific page after they choose a specific item from the drop down. I would like to point each option from the drop down - 1 month, 6 months, and 1 year to a different page for each one. I tried to work off of this thread -> Custom Redirect Forum Post, but am still unsuccessful. I have the code provided by @creedonin the header, but it's still not forwarding to the sites (they are random sites on my page for now, but will be the correct page in the near future). Any ideas? Thanks! i also tried it and successful Link to comment
wcbailey Posted September 7, 2021 Share Posted September 7, 2021 (edited) URL for the form selection - https://www.ckesn.com/service-network Hi @creedon. I am looking for some help on this as well. I am trying to redirect based on selection. Each state would go to its corresponding blog post. I think I have copied the code correctly but cant get it to direct properly. Any chance you could help out? Edited September 7, 2021 by wcbailey Link to comment
creedon Posted September 8, 2021 Share Posted September 8, 2021 @wcbailey Are you married to having the form set to lightbox? My code wasn't designed to work with lightbox forms. If not I have updated my cited 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
wcbailey Posted September 8, 2021 Share Posted September 8, 2021 13 hours ago, creedon said: @wcbailey Are you married to having the form set to lightbox? My code wasn't designed to work with lightbox forms. If not I have updated my cited code. I wasn't sure how to use your updated code because I couldn't get it to work so I just tried to turn the lightbox off. It still isn't working so I am not sure what I broke. Link to comment
creedon Posted September 8, 2021 Share Posted September 8, 2021 @wcbailey Two issues. Remove the following line. <script src="https://d1j8mu9lowy9zf.cloudfront.net/twcsl/0.1d7/twcsl.js"></script> It is no longer needed for the current code. The option url pairs should have no empty lines. Following is a partial example. fbsfpsrc Alabama https://www.ckesn.com/state/Alabama Alaska https://www.ckesn.com/state/Alaska Becomes. fbsfpsrc Alabama https://www.ckesn.com/state/Alabama Alaska https://www.ckesn.com/state/Alaska Your URLs could go from https://www.ckesn.com/state/Alabama to /state/Alabama, if you want. Either will work. The latter is an internal URL. You can even mix external and internal forms. The code doesn't care. It just blindly stuffs whatever you type into the proper place for SS to do it's magic with the redirect. Let us know how it goes. tuanphan 1 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment