Redirect page to specific URL based on text field value
-
After trying different ways of doing this, I can’t get it to work properly.
This is my Contact 7 Form
<label> First Name* [text* your-name] </label> <label> Last Name* [text* last-name] </label> <label> Your Email* [email* your-email] </label> <label> Zip* [text* zip] </label> [recaptcha] [submit “Sign up now”]
I want to redirect to 2 different confirmation pages based on the zip code they put in.
I have this but it doesn’t work..
on_sent_ok: “var zip = $(“text[name=zip]”).val(); if(zip == ‘94619’ ){ location = ‘https://dev-pier39.pantheonsite.io/confirmation’; } else { location = ‘https://dev-pier39.pantheonsite.io/fun-pack-coupon-confirmation’; }”
Any idea what I am doing wrong?
Thanks in advance.
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
- The topic ‘Redirect page to specific URL based on text field value’ is closed to new replies.