function checkTextAreaLen( fName, theField, maxLen ) { if ( theField.value.length > maxLen ) return msgErrorMid( fName, theField, maxLen, "Please enter less than ", " characters into the \"", "\" field. \nCurrently there are " + theField.value.length + " characters in the field." ); return true; } ## and here is the onChange that invokes it from a textarea, limiting to 1500 chars onChange="checkTextAreaLen(gsJobdesc,this,1500)