Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Redirect To a Specific Page Depending on Form Dropdown


mmontg18
Go to solution Solved by creedon,

Question

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 post
  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

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 t

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';

This worked perfectly! Thanks so much, @creedon! 

Posted Images

4 answers to this question

Recommended Posts

  • 1

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.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to post
  • 1

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.

361384780_ScreenShot2021-03-27at8_25_37PM.png.65fd110ffe606c18970b993837fb895e.png

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.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to post
  • 0
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 post

Create an account or sign in to comment

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


×
×
  • Create New...