<!-- START code for redirect depending on selected radio button option -->
<script>
$(document).ready(function() {
//define radio button label
var radioButtonLabel = 'Workshop Date/Time';
//define array with redirect URLs for each option
var redirectUrlsArray = ['https://facebook.com', 'https://google.com'];
//DO NOT EDIT BELOW THIS LINE
//define radio button element
var $radio = $('input[name="' + window.btoa(radioButtonLabel) + '"]');
//define array with options
var optionsArray = [];
$radio.each(function(i, e) {
optionsArray[i] = $(e).val();
});
//define change event
$radio.change(function() {
//go through the array
for (var i = 0; i < optionsArray.length; i++) {
//find the selected option
if ($(this).val() === optionsArray[i]) {
//switch the redirect URL with the one corresponding to that option
$(this).closest('form').find('input[name="redirect"]').val(redirectUrlsArray[i]);
}
}
});
});
</script>
<!-- END code for redirect depending on selected radio button option -->
<!-- START code for redirect depending on selected radio button option -->
<script>
$(document).ready(function() {
//define radio button label
var radioButtonLabel = 'Radio';
//define array with options
var optionsArray = ['Opt1', 'Opt2'];
//define array with redirect URLs for each option
var redirectUrlsArray = ['https://instapage.com', 'https://google.com'];
//define change event
$('input[name="' + window.btoa(radioButtonLabel) + '"]').change(function() {
//go through the array
for (var i = 0; i < optionsArray.length; i++) {
//find the selected option
if ($(this).val() == optionsArray[i]) {
//switch the redirect URL with the one corresponding to that option
$(this).closest('form').find('input[name="redirect"]').val(redirectUrlsArray[i]);
}
}
});
});
</script>
<!-- END code for redirect depending on selected radio button option -->