I had a developer create a simple redirect script that sends users to a page based on a postal (zipcode) the script works great, but whenever the form is submitted, I do not get an email alert and the submission data is not stored in /forms.
Can anyone offer a fix to solve this?
script start:
$(function() {
$(‘#wf-form-HomePage’).submit(function() {
var url = ‘/bookref’;
var pc = ($(‘#Postal-Code’).val() || ‘’).trim().toLowerCase();
// Duplicate more of these lines below to set more redirects
if(pc.includes(‘a’)) url = ‘/city/newfoundland-and-labrador’;
if(pc.includes(‘b’)) url = ‘/city/nova-scotia’;
if(pc.includes(‘b3’)) url = ‘/city/halifax’;
location.href = url;
return false;
});
});
script end
script start
$(‘a.Submit’).click(function (e) {
e.preventDefault(); // prevent default anchor behavior
var goTo = this.getAttribute(“href”); // store anchor href
setTimeout(function(){
window.location = goTo;
},1500);
});
script end.