WORD COUNT USING JAVASCRIPT FUNCTION
<script>
function checkwords(cur){
var maxwords=10
if (document.images){
var temp=cur.words.value.split(" ")
if (temp.length>maxwords){
alert("Please restrain your input to 10 or less words!");
document.getElementById('words').focus();
return false;
}
}
}
</script>
<form onsubmit="return checkwords(this)">
<strong>In 10 words or less, please tell us your qualifications:</strong><br><textarea rows="5" cols="38" name="words" id='words'></textarea>
<br><input type="submit" value="Submit!">
</form>
<script>
function checkwords(cur){
var maxwords=10
if (document.images){
var temp=cur.words.value.split(" ")
if (temp.length>maxwords){
alert("Please restrain your input to 10 or less words!");
document.getElementById('words').focus();
return false;
}
}
}
</script>
<form onsubmit="return checkwords(this)">
<strong>In 10 words or less, please tell us your qualifications:</strong><br><textarea rows="5" cols="38" name="words" id='words'></textarea>
<br><input type="submit" value="Submit!">
</form>
No comments:
Post a Comment
Thank your for your comment..your submitted coment will be live after admin approval