Help !!

admin

Administrator
Staff member
Hi I am new to javascript and web dev. In the following code I am trying to open a window to validate username & pwd. The window is opening but when the buttons are clicked nothing is happening. please advise.
Thanks,
Raktim.

<SCRIPT Language="JavaScript">
var writeWin = null;
var wd = null;
var writeWin = null;
function writeLeft()
{
writeWin = window.open('','aWin','top=0,left=0,width=350,height=350');
var ePen = '<html><head><title>Login</title></head>';
ePen += '<body text="#cccccc">';
ePen += '<Form name="logonForm" method="GET" onSubmit="return ValidateForm(this)">';
ePen += '<p align="left"><font color="#009999">Email</font> </p>';
ePen += '<INPUT TYPE=text NAME=email VALUE=http://www.webdeveloper.com/forum/archive/index.php/"" MAXLENGTH=60 SIZE=20>';
ePen += '<p align="left"><font color="#009999">Password</font> </p>';
ePen += '<INPUT TYPE=password NAME=passwd VALUE=http://www.webdeveloper.com/forum/archive/index.php/"" MAXLENGTH=60 SIZE=20>';
ePen += '<input type="submit" value=http://www.webdeveloper.com/forum/archive/index.php/"Submit" name="Submit">';
ePen += '<INPUT type="button" value=http://www.webdeveloper.com/forum/archive/index.php/" Ok " name="Ok" onClick="VerifyLogin">';
ePen += '<INPUT type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Cancel" name="Cancel" onClick="Closewin()">';
ePen += '</form></body></html>';
wd = writeWin.document;
wd.open();
wd.write(ePen);
wd.close();
}

function Closewin ()
{
alert ("Cancel Clicked");
writeWin.close();
}
function VerifyLogin()
{
alert ("Submit Clicked");
}

function ValidateForm(form)
{
alert("In Here");
if ( (witeWin.document.form.passwd.value == "") || (witeWin.document.form.email.value == ""))
{
alert("Please fill in all required fields.");
return false;
}
if ((witeWin.document.form.passwd.value == "1234") && (witeWin.document.form.email.value == "raktim"))
{
return true;
}
}

//-->
</SCRIPT>
<html><head></head>
<body onload="JavaScript:writeLeft()">
</body>
</html>
 
Back
Top