I have several input html controls that need to validate their value length. Means they should not be have greater than two characters.
I have written the function in javascript for one control. I want to write the generic function so that i can use that function for all input controls.
function CheckCharLength()
{
if(document.getElementById("txtstate").value.length < 2)
{
alert("Enter Valid State Code");
document.getElementById("txtstate").focus();
return false;
}
}