I have many textarea,I want to check input length. if not longer than 10 words, can't submit. It will alert,but still submit.
function checkinput(){
$('.TextArea').each(function() {
var textl = $(this).val().length;
if ( textl < 10 && (EndTime.getTime()-Time != 0)) {
window.alert ( "answer need large 10 word!" );
return false;
}
});
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form method="POST" action="answer.php" id="form" onsubmit="return checkinput();">