...

View Full Version : problem loading frames....pls help!



reigalz
04-09-2003, 03:22 PM
i have 3 frames for my web site.....one on top, on left and the other right....i have a user login on the top frame, when the user click the login button, i want the top and bottom right frame to go to different pages...how do i do it? i noe there's a way, but i have form in the code where which will pass the variables to another page, so there's a problem...can someone help?

here's my code for the top frame with the user login:

<html>
<head>
<title>Welcome!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

<script language="JavaScript">

function checkinput() {

var username = document.login.username.value;
var pass = document.login.pass.value;
var a = 0;

if(username.length==0) {

window.alert("Please enter a username!");

document.login.username.focus();

a = 1;

return false;

} else if(username.length>0) {

if(username.length<6) {

window.alert("Username is more than 6 characters or numbers!");

document.login.username.value = "";

document.login.username.focus();

a = 1;

return false;

} else {

string = login.username.value;
var searchFor = "[^A-Za-z0-9_]";
s = string.search(searchFor);

if(s==-1) {

} else {

window.alert("You have entered invalid characters!\n Please avoid using !@#$%^&*\(\) characters!");

document.login.username.value = "";

document.login.username.focus();

a = 1;

return false;

}

}

}

if(a==0 && pass.length==0) {

window.alert("Please enter a password!");

document.login.pass.focus();

a = 1;

return false;

} else if(pass.length>0) {

if(pass.length<6) {

window.alert("Password is more than 6 characters or numbers!");

document.login.pass.value = "";

document.login.pass.focus();

a = 1;

return false;

} else {

string = login.pass.value;
var searchFor = "[^A-Za-z0-9_]";
s = string.search(searchFor);

if(s==-1) {

} else {

window.alert("You have entered invalid characters!\n Please avoid using !@#$%^&*\(\) characters!");

document.login.pass.value = "";

document.login.pass.focus();

a = 1;

return false;

}

}

}


top.rightFrame.document.location="CheckLogin.asp"
top.topFrame.document.location="Top_Frame.htm"


}

</script>

<body background="../Pictures/Interface.jpg" link="#0000FF" vlink="#0000FF" alink="#0000FF">

<form name="login" method="post" action="CheckLogin.asp" onSubmit="return checkinput()">

<table align="right">

<tr>
<td><font color="white" face="Arial" size="-1"><strong>Username:</strong></font></td>
<td><input type="text" name="username" size="13" maxlength="20"></td>
<td width="20">&nbsp;</td>
</tr>

<tr>
<td><font color="white" face="Arial" size="-1"><strong>Password:</strong></font></td>
<td><input type="password" name="pass" size="13" maxlength="20"></td>
<td>&nbsp;</td>
</tr>

<tr>
<td></td>
<td align="right"><input type="image" src="..\Pictures\Buttons\login.gif"></td>
<td>&nbsp;</td>
</tr>

<tr>
<td colspan="2">
<font face="Arial" size="-1">Not a member?</font>
<font face="Arial" size="-1"><a href="Registration.asp" target="rightFrame">Sign up here</a></font>
</td>
<td>&nbsp;</td>
</tr>

</table>

</form>

</body>
</html>

ACJavascript
04-10-2003, 12:26 AM
instead of
top.rightFrame.document.location="CheckLogin.asp"
top.topFrame.document.location="Top_Frame.htm"

try
parent.rightFrame.document.location="CheckLogin.asp"
parent.topFrame.document.location="Top_Frame.htm"

or

top.rightFrame.document.location.href="CheckLogin.asp"
top.topFrame.document.location.href="Top_Frame.htm"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum