My form is calling the following function. It works on desktop and the user is directed to the download-confirmation/failure page.
However, on mobile (tested on iOS and iPad), the user is not redirected. Can anyone shed some light?
Function
function submit_form()
{
var email = document.getElementById("main-email-field").value
// todo email validation
if (email.length > 7)
{
window.location = '/download-confirmation'
}
else
{
window.location = '/download-failed'
}
return false;
}
Form
<form id="main-email-form" class="email-form" method="POST" onsubmit="submit_form()" action="https://europe-west1-hoddle-website.cloudfunctions.net/registerUser" target="hiddenFrame">
<input id="main-email-field" class="main-email-field" type="email" name="email" placeholder="Email address">
<button id="main-email-button" class="main-email-button">Download</button>
<input type="hidden" id="main-referralID-field" name="referralID" value="">
<input type="hidden" id="main-referralType-field" name="referralType" value="">
<input type="hidden" id="main-referralUserID-field" name="referralUserID" value="">
</form>
<iframe id="hiddenFrame" class="hiddenFrame" name="hiddenFrame" width="0" height="0" border="0" style="display: none;"></iframe>