我的表单正在调用以下函数。它在桌面上运行,用户被定向到下载确认/失败页面。
但是,在移动设备上(在 iOS 和 iPad 上测试过),用户不会被重定向。任何人都可以阐明一下吗?
功能
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 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>
梵蒂冈之花
相关分类