Is it possible to redirect to an external url after clicking Submit button only if a certain Form field is selected? If possible, where do I start?
I have a Contact Me form. In the form, there’s three options… respond only via email, Call, or Text. What I’m after here, is if they select Call, after Submitting their inquiry, I would like to redirect them to my Calendly page to set call date & time.
Hi there! You can do this through a conditional statement. The way you do this is by enabling dev mode, naming the input field with the three options, and setting the redirect link once an option has been pressed. The code will look something like:
On click of button:
Check response:
If response === call:
go to URL (calendly url);
else:
go to URL (other url);
Thank you. I’ll give this a try and report back.
Below is what I have so far, not sure it’s correct.
a) Is it possible for this code to only react to one of the respondGroup1 value?
b) Will the submit button submit form as it would w/o the code?
export function submit1_click(event, $w) {
let option = $w("#respondGroup1").value;
if ( option === "respond1" ) {
wixLocation.to("URL1");
} else {
wixLocation.to("URL2");
}
}