Jump to content

beardfacedesign

Circle Member
  • Posts

    2
  • Joined

  • Last visited

Reputation Activity

  1. Like
    beardfacedesign reacted to creedon in Redirect to Specific Page Based on Form Answer   
    Add the following to Settings > Advanced > Code Injection > HEADER. 
    <script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> Add the following to Page Settings > Advanced > Page Header Code Injection for the page with the form.
    <script>   $( ( ) => {    // begin dining outlet redirect const formSelectId = 'select-yui_3_17_2_1_1604067328695_32418-field'; const redirects = { /* enter options from select form field and redirect URL Slug or External URL */ 'Corks' : '/corks-x', 'Dining Room (Restaurant)' : '/dining-room-x', 'Lobby Bar' : '/lobby-bar-x', 'Tavern' : '/tavern-patio' }; // don't change anything beyond this point let $formSelect = $( '#' + formSelectId ); // get the redirect form let $form = $formSelect.closest ( 'form' ); $formSelect.change ( function ( ) { let url = $( this ).val ( ); if ( url !== '' ) url = redirects [ url ]; $form.attr ( 'data-success-redirect', url ); } ); /* end dining outlet redirect */     } ); </script> Let us know how it goes.
×
×
  • 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.