aman gandhi

aman gandhi

  • NA
  • 22
  • 95.7k

Java Script not working in Firefox

Sep 8 2012 7:55 AM
i am using below javascript in my applicaion. its working fine in IE but not working Properly in firefox.


<script type="text/javascript">
function CountChars(CharLimit,InputID,OutputID) {
var enterchar;
var textboxvalue;
var remainingchars;
enterchar = document.getElementById(InputID).value.length;
textboxvalue = document.getElementById(InputID).value;
remainingchars = CharLimit - enterchar;
document.getElementById(OutputID).innerHTML = remainingchars + " Characters Left(max:156 Characters)";
if (remainingchars <= 0) {
document.getElementById(OutputID).innerHTML="0 Characters Left(max:156 Characters)";
alert("you have reached the limit");
document.getElementById(InputID).innerHTML = textboxvalue.substring(0, CharLimit);
}
}

</script>


its working partially. its calculating the remaining char but substring fun is not working in firefox.

Aman Gandhi

Answers (1)