Count Letters with MAX 10

[Total: 0    Average: 0/5]

Users can type their Messeges in a Text box and the second text box will keep Counting how many letters has been entered.

Head Code:

<Script>
function alll() {
var m = document.f1.t1.value;
var mm = m.length;
document.f1.t2.value = mm;
if(mm >= 10) {
alert("Max is 10");
document.f1.t1.value = "";
}
setTimeout("alll()" ,0);
}
</Script>

Body Code:

<form name = "f1">Enter your Messege(Max is 10) : <input type = "Textbox" name = "t1" onfocus="alll()"><br>
Here is the Amount you enterd &nbsp; &nbsp;:<input type = "Textbox" name = "t2"></form>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *