Web Analytics Made Easy -
StatCounter A problem: function is not defined - CodingForum

Announcement

Collapse
No announcement yet.

A problem: function is not defined

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • A problem: function is not defined

    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:
    function guardMaxLength(ta,event)
    {  
        maxlength=parseInt(ta.maxlength,10);
        if(ta.value.length>=maxlength)
        {   
           return false
        }
        ta.value=value;
    }

    Code:
    <script type="text\JavaScript" src="checkLength.js">
    
    </script>
    <textarea maxlength="10" onkeypress="return guardMaxLength(this, event)" >
    Thanks a lot!

  • #2
    Code:
    <script type="text\JavaScript" src="checkLength.js">
    
    </script>
    should be
    Code:
    <script type="text/javascript" src="checkLength.js">

    Comment

    Working...
    X