Conditional Redirection upon SUBMIT
-
Hi,
Were Am I going wrong? When a person selects A (Radio button) then it should redirect to http://www.abc.com else when a person selects B (radio button) it should go to http://www.xyz.com. email will universal so it will go anyways
<p class=”submitForm”>[submit “Submit”]</p>
<script>
jQuery(document).ready(function($){
document.addEventListener( ‘wpcf7submit’, function( event ) {
var get_selected_opt = $(“select[name = radio-109]”).val(); //get the selected value
if (get_selected_opt == ‘A’) {
location = ‘https://www.abc.com’;
}
else{
location = ‘http://www.xyz.com/thankyou/’;
}
}, false );
});
</script>Please help
Thanks
The topic ‘Conditional Redirection upon SUBMIT’ is closed to new replies.