したがって、基本的には、テキスト領域で特定の単語数に達するまで送信ボタンを無効にする必要があります。
私は周りを見回して、それを行う方法を見つけようとしましたが、運がありませんでした.
ヒントやヘルプはありますか?
<form method="post" id="writearticle" action="submitarticle.php">
<script>
$('#writearticle').submit(function(event) {
var text = $("#content").val();
text = text.split(" ");
// check for at least 10 words
if(text.length < 10){
console.log("prevented");
// prevent submit
event.preventDefault();
return false;
}
console.log("submitted");
});
</script>
<textarea rows="30" cols="85" id="content" name="content" placeholder="Write the article here. Try to abide by the instructions and keywords provided."></textarea>
<br />
<input type="submit" name="submitarticle" value="Submit Article" class="submit" />
<br /><br /><br /><br /><br />
</form>