if (navigator.appVersion.indexOf("Mac") !=-1 && navigator.appName=="Microsoft Internet Explorer"){ document.write(''); } else if (navigator.appVersion.indexOf("Mac") !=-1){ document.write(''); } else if (document.layers && !document.getElementById){ document.captureEvents(Event.KEYPRESS) document.write(''); } else if (document.getElementById && !document.all){ document.write(''); } else if (document.all){ document.writeln(''); } /** * Limits the amount of text in the specified text area (formName.textAreaName) to 'maxLength' * number of characters. * * @param formName the form that contains the text area * @param textAreaName the text area to check * @param counterName the counter form field to update * @param maxLength the maximum number of characters allowed in the form field. */ function countText( formName, textAreaName, counterName, maxLength , hiddenMessageText) { currentLength = eval( 'document.'+formName+'.'+textAreaName+'.value.length' ); if(hiddenMessageText && currentLength != maxLength){ eval( 'document.' + formName + '.elements[\"'+hiddenMessageText + '\"].value = ' + currentLength ); } // If the user entered more than 'maxLength' characters, truncate the string if ( currentLength >= maxLength ) { eval( 'document.'+formName+'.'+textAreaName+'.value = document.'+formName+'.'+textAreaName+'.value.substr( 0, '+maxLength+')' ); } // Update the value of the counter field eval( 'document.'+formName+'.'+counterName+'.value = ' + maxLength + ' - document.'+formName+'.'+textAreaName+'.value.length' ); }