Form with custom redirect not capturing entries on iPhone

I have a form set up with a custom redirect added into the embed code based off of the form entry. For some reason, this code is causing submissions from iPhones to not register in HubSpot. When I remove those lines of code, submissions go through. With the lines of code added in, submissions are registered from desktops, iPads, and Android phones, but not iPhones. Any reasons why this could be happening?

Here is the code:
<script charset=“utf-8” type=“text/javascript” src=“//js.hsforms.net/forms/embed/v2.js”></script>
<script>
hbspt.forms.create({
region: “na1”,
portalId: “40238620”,
formId: “3dfe8346-288f-43fe-bc84-e2b55d39f3f6”,
target: “.form-column”,
onFormSubmit: function($form) {
var choice = $form.find(‘input[name=desired_wedding_package]:checked’).val();
if (choice == ‘Best Weekend Ever’) {
window.location.href = ‘https://zionsprings.com/schedule-a-tour-date-time/’;
}
else if (choice == ‘Best Day Ever’){
window.location.href = ‘https://zionsprings.com/schedule-a-tour-date-time/’;
}
else if (choice == ‘Mini-mony’){
window.location.href = ‘https://zionsprings.com/book-elopement-meeting/’;
}
else if (choice == ‘Elopement’){
window.location.href = ‘https://zionsprings.com/book-elopement-meeting/’;
}
else if (choice == “I don’t know yet”){
window.location.href = ‘https://zionsprings.com/schedule-a-tour-date-time/’;
}
}
});
</script>

You are using the wrong form submit action. https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options

onFormSubmit is used after the validation, but before the form data is submitted.

onFormSubmitted is used after the validation is complete AND the form data is submitted to hubspot.

Basically what is happening is the form is redirecting before any data is submitted. I cannot explain why in your testing scenario that this is happening only on iPhones. This thread gives some different use case examples as well that is worth reading through to help with how to set this up: https://community.hubspot.com/t5/APIs-Integrations/Include-form-fields-as-redirect-URL-parameters-on-an-embedded/m-p/235041 .

I have tried using onFormSubmitted and the page does not redirect anymore.