Jump to content

meeshell638

Circle Member
  • Posts

    1
  • Joined

  • Last visited

Posts posted by meeshell638

  1. I'm trying to create two redirections depending on the answer to the radio question on this page: https://www.raddaconnect.com/start-application

    When they choose “One Applicant,” I want it to redirect to this page after they click the Start Application button: https://www.raddaconnect.com/one-applicant-application

    When they choose “Multiple Applicants (Ideal application for teachers and families with multiple applicants),” I want it to redirect to this page after they click the Start Application button: https://www.raddaconnect.com/multiple-applicants-application

    I currently have a code block with the following code, but it doesn't redirect at all: 

    <script>
    function redirect() {
      var radioButtons = document.getElementsByName('radio-6f1d6d49682a9f0016b049c6b83d40c3');
      for (var i = 0; i < radioButtons.length; i++) {
        if (radioButtons[i].checked) {
          var value = radioButtons[i].value;
          if (value == 'One Applicant') {
            window.location.href = 'https://www.raddaconnect.com/one-applicant-application';
          } else if (value == 'Multiple Applicants (Ideal application for teachers and families with multiple applicants)') {
            window.location.href = 'https://www.raddaconnect.com/multiple-applicants-application';
          }
          break;
        }
      }
    }
    document.addEventListener('DOMContentLoaded', function() {
      var form = document.getElementById('block-yui_3_17_2_1_1649675282424_10012');
      form.addEventListener('submit', function(event) {
        event.preventDefault();
        redirect();
        form.submit();
      });
    });
    </script>

     

    Any help would be greatly appreciated! Thanks in advanced!

×
×
  • 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.