Foster 68 Posted January 30 Share Posted January 30 Hello, I am looking something allowing to check the number of character inside a textarea without jquery. There are some solution, but I like the code below because he is very short. It's for some people want to do create a form as contact, feedback, reviews, comment ... It can be useful If the number of character is not reach, a pop up appear on the screen. <form action="mango.php" method="post" id="form12" onsubmit="var text = document.getElementById('checkField').value; if(text.length < 80) { alert('put more info!'); return false; } return true;"> <textarea rows="10" cols="80" maxlength="200" required id="checkField" > </textarea> </form> 2 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.