have u develope this code in ASP.NET ? if yes then use
MaxLength property of textbox. it will help you to restrict the length to 100.
otherwise here is javascript function
function Max_LengthLimit_100(obj)
{
if (obj.value != "")
{
if (value.length > 100)
return false;
}
}
call this function on
onkeypress="return Max_LengthLimit_100(this.id)"