This is a very simple maxlength script, quickly and easily implemented. The original is found at http://www.dynamicdrive.com/dynamicindex16/maxlength.htm
/***********************************************
* Textarea Maxlength script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}
Update: Here is one that includes a remaining characters counter:
http://www.mediacollege.com/internet/javascript/form/limit-characters.html