myform has no properties

If you've had any problems with Nexuiz, or would like to report bugs, post here.

Moderators: Nexuiz Moderators, Moderators

Tue Jul 03, 2007 2:47 am

  • keep getting this error on the forum index.

    Code: Select all
    <script language="javascript">
    myform=(document.all)?document.all("logform"):document.getElementById("logform");
    myform.username.focus();
    </script>


    it should be

    Code: Select all
    <script type="text/javascript">
    myform=document.getElementById("logform");
    if(myform != undefined) myform.username.focus();
    </script>
    User avatar
    Psychcf
    Forum addon
     
    Posts: 1554
    Joined: Sun Dec 03, 2006 11:38 pm
    Location: NY, USA

Tue Jul 03, 2007 6:54 am

  • Actually, no, this document.all stuff exists on some M$ browsers that did not support getElementById, so it has to be done that way...

    However, it should be document.all["logform"] and not round parentheses.

    However, in this specific case, why not use the old method - give the form a NAME="logform" (as opposed to ID) and then document.logform.username.focus()? That's what works in every browser...
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE



Return to Nexuiz - Support / Bugs




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest