Based on followup question:
"i want that while typing in the text box itself if max limit reached the user get prompted". This will not prompt.
Steps:
1. Define a onkeyup for the textbox
2. Tie up a Javascript funtion to onKeyup
3. check the length and prompt.
Sample:
HTML:
<input type"text" id="mytb" onkeyup="CheckLength(this.value);"/>
JS Code:
function CheckLength(currentValue)
{
if(currentValue.length > 6)
alert("Only 6 letters are allowed, please follow the rule!");
}
You can modify the implementation as per your need.