29 users online (1 members and 28 guests)  


  Results 1 to 2 of 2

Related

  1. HTML Function    Forum: Javascript Forum
    Replies: 2
  2. mysql query / function problem....    Forum: Databases
    Replies: 7
  3. Save output in user-defined location?    Forum: PHP Forum
    Replies: 2
  4. die function    Forum: CGI Perl Forum
    Replies: 2
  5. problem with function mail()    Forum: PHP Forum
    Replies: 6
  1. #1
    irida's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2006
    Posts
    3

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

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

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Function not defined problem

    from the looks of it... it is because it is not loading the javascript or trying to execute that function before it has been loaded.

    you can disable it and have a function in the onload in the <body tag that enables it. that way it works right...

    if it is not loading... (i seriously doubt this is the problem) try lowering the case in the type= of the script... usually mime types are not capitalized atall



Tags for this Thread