- requiredが動いた後、formをsubmitしています。
- また、二重submitできないようにbuttonのdisabledをtrueにしています。
test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form method="post" id="hogeForm">
<input type="text" name="hoge1" required>
<input type="text" name="hoge2" required>
<button type="submit" class="btn-send">送信</button>
</form>
</body>
<script src="/js/jquery.min.js"></script>
<script>
$(function() {
$('#hogeForm').submit(function(e) {
$('.btn-send').prop('disabled', true);
});
});
</script>
</html>