在发送表单时,我使用了一个脚本来显示“谢谢消息”,但是“谢谢消息”正在取消输入的“验证”,此外,您可以在输入时不发送任何值。
我需要此验证来检查其是否为有效电子邮件,以及 不为空。我该如何解决?
这是我的表单代码:
<div id="btnsucess"><p>Obrigado!</p></div>
<div id="formhide">
<form action="https://ws.inversapub.com/subscribe" data-validate="https://lp.inversapub.com/wp/wp-admin/admin-ajax.php" method="POST" target="hiddenFrame">
<input name="emailAddress" type="email" required="" oninput="this.setCustomValidity('')" oninvalid="this.setCustomValidity('Preencha um endereço de e-mail válido.')" placeholder="Coloque aqui seu e-mail" class="input-email" />
<input type="submit" value="QUERO ME INSCREVER" class="btn-submit" id="btnclick"/>
<input name="sourceId" type="hidden" value="XV-MEL-WV-FRI-X-X-LP-X-X" />
<input name="listCode" type="hidden" value="inv_hotlist_fri" />
<input name="redirect" type="hidden" value="https://lp.inversapub.com/profit-hunter-concluido/" />
<input name="email_page" type="hidden" value="inv_welcome_fri" />
</form>
<iframe name="hiddenFrame" width="0" height="0" border="0" style="display: none;"></iframe></div>
脚本:
<script>
document.getElementById("btnclick").onclick = function() {myFunction()};
function myFunction() {
document.getElementById('formhide').style.display = "none";
document.getElementById('btnsucess').style.display = "block";
};
</script>
短信正在取消脚本:
oninput="this.setCustomValidity('')" oninvalid="this.setCustomValidity('Preencha um endereço de e-mail válido.')"