+ Start a Discussion
sateesh_sfdc@yahoo.comsateesh_sfdc@yahoo.com 

How to write counter characters on rich text area data type

Here it is a sample code it work only text area data type pls send me solution very urgent

<apex:page >
<script type="text/javascript">
var maxLength=100;
function charLimit(el) {
if (el.value.length > maxLength) return false;
return true;
}
function characterCount(el) {
var charCount = document.getElementById('charCount');
if (el.value.length > maxLength) el.value = el.value.substring(0,maxLength);
if (charCount) charCount.innerHTML = maxLength - el.value.length;
return true;
}
</script>
<apex:form >
<apex:inputtextarea onKeyPress="return charLimit(this)" onKeyUp="return characterCount(this)" rows="8" cols="40" />
</apex:form>
<p><strong><span id="charCount">100</span></strong> more characters available.</p>
</apex:page>