...

View Full Version : Need help on opening a form element in another frame



HELLSS
06-26-2002, 01:26 PM
page this is located at (http://customc.net/hosted/hellssite/war2nh/index.html)

Here's the deal, in that bottom frame I have 2 things setup... a "quick menu" and info to log into an account for a game this layout is being made for. I have the quick menu working right, it opens its links in the top frame. But I don't know how to apply opening in the top frame to the login part.

The following is all the coding in the bottom frame:


<HTML>
<HEAD>
<TITLE>choices</TITLE>
<style type="text/css">
.center { text-align:center }
A:visited {text-decoration: none;}
A:hover {color:"#FDB789"}
A:link {text-decoration: none;}
A:active {text-decoration: none;}
table.d3 {
background: none;
border-width: 2px;
border-color: #2C221C;
border-style: solid;
}
</style>
<script>
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->
</script></HEAD>
<body bgcolor="#000000" text="#FFD0B0" link="#FDAB35" vlink="#FDAB35" alink="#FDB789">
<span style="position:absolute; top:4; left:15;">
<table cellspacing="1" cellpadding="1" border="0" class="d3">
<tr>
<td bgcolor="#2C221C" width="9">&nbsp;</td>
<td bgcolor="#1D1713" width="240" height="30" ><div align="center">
<form action="dummy" method="post"><select name="choice" size="1" style="background-color: #1D1713; color: #c0c0c0; font-family: Verdana;"><option>War2:NH Quick Menu</option>
<option value="http://link.com/*main">.News</option>
<option value="http://link.com/*main">.Sign Up</option>
<option value="http://link.com/*main">.Forum</option>
<option value="http://link.com/*main">.Rankings</option>
<option value="http://link.com/*main">.Help</option>
<option value="http://link.com/*main">.Staff</option>
<option value="http://link.com/*main">.Contact</option>
</select>&nbsp;<input TYPE="button" VALUE="Go to" onClick="jump(this.form)" style="background-color: #1D1713; color: #c0c0c0; font-family: Times New Roman; border: 3 solid #2C221C">
</div></td>
<td bgcolor="#2C221C" width="10">&nbsp;</td>
</tr>
</table></form></span>
<span style="position:absolute; top:4; left:305;">
<table cellspacing="1" cellpadding="1" border="0" class="d3">
<tr>
<td bgcolor="#2C221C" width="9">&nbsp;</td>
<td bgcolor="#1D1713" width="270" height="30" ><div align="center">
<form method='POST' action='WebWorld.cgi'>
<input type="text" name="name" value="Username" size="12" maxlength="40" onFocus="if(this.value=='Username') {this.value='';}" onBlur="if(this.value=='') {this.value='Username';}" style="background-color: #1D1713; color: #c0c0c0; font-family: Times New Roman; border: 2 solid #2C221C">
<input type="password" name="password" value="xxx" size="12" maxlength="40" onFocus="if(this.value=='xxx') {this.value='';}" onBlur="if(this.value=='') {this.value='xxx';}" style="background-color: #1D1713; color: #c0c0c0; font-family: Times New Roman; border: 2 solid #2C221C">
<input name="submit" type="button" value="Login" onClick="jump(this.form)" style="background-color: #1D1713; color: #c0c0c0; font-family: Times New Roman; border: 3 solid #2C221C">
</div></td>
<td bgcolor="#2C221C" width="10">&nbsp;</td>
</tr>
</table></form></span>
</BODY>
</HTML>


That first script is what makes the links in the drop down menu open in another frame. Any help in making that, or a new script able to do the same with the login part would make my day. thanks in advance for looking this over and helping :thumbsup:

P.S. - layout look ok in whatever browser you'r using? hehe ;)

HELLSS
06-27-2002, 09:36 AM
*bump* I really need a solution to this and still have no way of doing it.:(

glenngv
06-27-2002, 09:58 AM
<form method='POST' action='WebWorld.cgi' target="_top">

HELLSS
06-29-2002, 02:53 AM
Uploaded it, doesn't work. Tried making the target "main" since that's the main frame, even tried just using "_top" but it's not doing anything. Even tried making the webworld.cgi have the full url to it but it just does nothing.

am I overlooking something or is that target="" not gonna work?

bump... pretty important that I figure this out : /

adios
06-29-2002, 11:25 PM
Interesting:

function jump(menu).....
.....
if (ref != "") {land(loc,target);}
}

...and:

function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
....etc.....

You're passing the value of loc to your land() function, capturing it in the parameter variable ref - and then referencing it in that function as loc again. Shouldn't you be using ref instead?

Assume this:

else {parent.frames[target].location=loc;};
}}}
}

...is OK syntax & that you just simplified the code, leaving something out. Quite a few curlies there.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum