Onclick event; If and Else

LuxeMed

New Member
All right so I am doing a javascript code for a login type form and it will lead you to a new page. Here it is:\[code\]function submit1(){ var x=document.getElementById("username"); var y=document.getElementById("password"); if (x.valuehttp://stackoverflow.com/questions/13779263/=="username" && y.valuehttp://stackoverflow.com/questions/13779263/=="password") { window.location="Example.php"; } else { window.alert=("The information you have submitted is incorrect and needs to be submitted again!"); }}\[/code\]When ever I am hitting the submit button it takes me straight to the page instead of checking to see if it right. Please help!Thank you in advanced! To let you know this is not a permanet login page!
 
Back
Top