Validate the Maximum no. of Characters allowed in TextBox Using Java Script.

Chikul
Posted by Chikul under JavaScript category on | Views : 4971
//Function for Check Length
//CheckLength(txt,5) : It will allow only 5 Characters in text box.
function CheckLength(obj,Length)
{
if (obj.value.length>Length)
{
alert("Exceeding Maximum " + Length +" Characters")
obj.focus()
obj.select()
}
}

Comments or Responses

Login to post response