View Single Post
  #1 (permalink)  
Old Oct 4th, 2006, 13:30
irida irida is offline
New Member
Join Date: Sep 2006
Location: Ukraine
Age: 21
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Need your help: "fuction not defined" problem

Hello everybody! I have a problem, in IE my code works properly, but Firefox writes "Error: guardMaxLength is not defined" the code is following:

checklength.js
Code: Select all
function guardMaxLength(ta,event)
{    
    maxlength=parseInt(ta.maxlength,10);
    if(ta.value.length>=maxlength)
    {    
       return false
    }
    ta.value=value;
}
HTML: Select all
<script type="text\JavaScript" src="checkLength.js">

</script>
<textarea maxlength="10" onkeypress="return guardMaxLength(this, event)" >
Thanks a lot!
Reply With Quote