Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-26-2002, 01:26 PM   PM User | #1
HELLSS
New Coder

 
Join Date: Jun 2002
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
HELLSS is an unknown quantity at this point
Exclamation Need help on opening a form element in another frame

page this is located at

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:

Code:
<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

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

Last edited by HELLSS; 06-26-2002 at 01:31 PM..
HELLSS is offline   Reply With Quote
Old 06-27-2002, 09:36 AM   PM User | #2
HELLSS
New Coder

 
Join Date: Jun 2002
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
HELLSS is an unknown quantity at this point
bump

*bump* I really need a solution to this and still have no way of doing it.
__________________
blek..
HELLSS is offline   Reply With Quote
Old 06-27-2002, 09:58 AM   PM User | #3
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
<form method='POST' action='WebWorld.cgi' target="_top">
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-29-2002, 02:53 AM   PM User | #4
HELLSS
New Coder

 
Join Date: Jun 2002
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
HELLSS is an unknown quantity at this point
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?

Edit: bump... pretty important that I figure this out : /
__________________
blek..
HELLSS is offline   Reply With Quote
Old 06-29-2002, 11:25 PM   PM User | #5
adios
Senior Coder

 
Join Date: Jun 2002
Posts: 1,404
Thanks: 2
Thanked 32 Times in 32 Posts
adios is on a distinguished road
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.
adios is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:30 AM.


Advertisement
Log in to turn off these ads.