WordPress Contact Form 7 Radio-Button Conditional Redirect
-
I’ve seen a few questions similar to this on here, but no working answers, etc.
I have a Contact 7 form with a radio button with four options, which of 4 states you reside in. I need for when the form is submitted for it to redirect to that states page.
I have tried a number of different options, and a few have kind of worked… like this is what I currently have in the ‘Additional Settings’ area in Contact Form 7…
on_sent_ok: “var Iso = $(“input[name=your-city]:checked”).val() ; if(Iso == ‘1’ ){ location = ‘example.com/city2’; } else if (Iso == ‘2’ ){ location = ‘example.com/city2’; } else if (Iso == ‘3’ ){ location = ‘example.com/city3’; } else { location = ‘example.com/city4’; }”
Obviously the URL’s are full url’s in my code… Problem is it’s always going to /city4 no matter what is selected. I’ve heard this is because by the time it’s sent it’s not sending back the correct info, but how would I go about making this work then?
- The topic ‘WordPress Contact Form 7 Radio-Button Conditional Redirect’ is closed to new replies.