Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
    Last edited by HELLSS; 06-26-2002 at 01:31 PM.
    blek..

  • #2
    New Coder
    Join Date
    Jun 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    bump

    *bump* I really need a solution to this and still have no way of doing it.
    blek..

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    <form method='POST' action='WebWorld.cgi' target="_top">

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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..

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •