1
Hello,
When using jquery to disable the Submit button after being sent once the required attribute in input no longer works.
HTML
<form id="ajax" action="#teste" method="POST">
<p class="remodal-text">Nome</p>
<input type="text" name="nome" required>
<p class="remodal-text">E-mail</p>
<input type="email" name="email" required>
<p class="remodal-text">Assunto</p>
<input type="text" name="assunto" required>
<p class="remodal-text" required>Mensagem</p>
<textarea name="mensagem" name="mensagem"></textarea>
<input type="submit" value="Enviar" class="btn-submit" >
<div id="enviado" style="width: 100%; height: 60px;"></div>
</form>
JS
$(function(){
$(".btn-submit").click(function () {
$(".btn-submit").attr("disabled", true);
$('#ajax').submit();
});
});
Example in Codepen: http://codepen.io/flashpremium/pen/gpZZRv
That solves the problem, thank you Kazzkiq!
– the flash