Object Expected

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wangers16
    New Member
    • Jul 2007
    • 57

    Object Expected

    Hi,

    I am trying to create my own login script and I am new to javascript.

    I have created it in an external file and when I use it on the page I get the Object Expected error on line 13 char 1 could anyone help me please.

    Here is a copy of the code

    [CODE=javascript]<!--
    function login(){
    pass = password
    user = username
    log1 = document.securi ty.username.val ue
    log2 = document.securi ty.password.val ue
    if ( log1==user&&log 2==pass ){
    window.location ="success.ht m";
    }
    else {
    window.location ="fail.htm";
    }
    }
    // -->[/CODE]

    Thnx in advance
    Last edited by acoder; Aug 10 '07, 10:37 AM. Reason: Code in tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Please use CODE tags when posting code. Thanks.

    First things first: never use Javascript for login. It's too easy for someone to view the source and see the username and password.

    Coming to your problem, perhaps password and username should be strings: "password" and "username" respectively.

    Comment

    Working...