
Hi there all my first post here!
I have tried searching all the threads for what im looking for but cant seem to find anything that matches my needs!
I will try to be as clear as possible in my requirements and problems!
I currently have my home page that contains the following script:-
<A HREF="f:\ecommerce2\mysite\firstpage.htm" onClick="window.open('login.htm','window','width=800','height=2000');"</a>
<IMG BORDER="0" img src="businesspic.gif" width="185" height="235" align=left>
This is just a picture that when you click on it it brings up a smaller pop up page which asks for a login and user id.
Here is the script:-
</HTML>
</body><script type="text/javascript">
<!--
function authPass(u,p)
{if (u && p) self.location = "auth.htm?" + u + p;
return false;}
// -->
</script>
</head>
<body>
<div>
<script type="text/javascript">
<!--
if (location.search.indexOf("auth=failed") != -1) {
document.write("<span style=\"color:#ff0000\">Authorization Failed!</span>");
}
// -->
</script>
<form id="form1" action="javascript://" onsubmit="return authPass(this.user.value,this.pass.value)">
<table>
<tr>
<td>Username: </td><td><input type="text" name="user" /></td>
</tr>
<tr>
<td>Password: </td><td><input type="password" name="pass" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Login" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>
(I used a VBScript to formulate a password i.e. u + p = username and password)
If i click submit and enter the correct user name and password the page will then take me to the next relevant page in the same pop up page!
(Also my next page it should go to is called businesspage, and it does go to this but I cannot see it in the code above so I have no idea where and how it does it!)
What I want is once I enter the correct password and username to close the pop up page and then in the main page to proceed to the next relevant page!
I hope below makes it clearer!
What currently happens-
Main page --> popup page --> correct login --> pop up box remains open and goes to the next page --> main page remains static thus 2 pages are open
What i want-
Main page --> popup page --> correct login --> close pop up box --> Main page changes to the next relevant page
Please help as it would be very much appreciated!
Thanks
Nam!