|
We are trying to implement a counter for the character in an open-ended textarea question and we are using the JavaScript to do the following 2 functions:
Ø Validate the number of characters remaining in the textarea.
Ø Provide an alert when limit of characters is reached.
Now, the issue is that same page is working fine in Internet Explorer but it is not working in the Mozilla web browser.
Please provide us with some solution for above problem. Your prompt reply will be appreciated.
I am using the following script:
<script language = "Javascript">
function taLimit() {
var taObj=event.srcElement;
if (taObj.value.length==taObj.maxLength*1) return false;
}
function taCount(visCnt) {
var taObj=event.srcElement;
if (taObj.value.length>taObj.maxLength*1) taObj.value=taObj.value.substring(0,taObj.maxLength*1);
if (visCnt) visCnt.innerText=taObj.maxLength-taObj.value.length;
}
<TR><TD align="center"><br>
<TEXTAREA onkeypress="return taLimit()" onkeyup="return taCount(myCounter)"
name="cus43_oe1" rows=7 wrap=physical cols=75 maxLength="1000" align="center">
|
|
|
|
|
|
|
|