meeshell638 Posted March 29 Share Posted March 29 (edited) 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! Edited March 29 by meeshell638 Fixing a typo 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