Forum Moderators: open
Firstly, I have a couple of sites that I want to link together and started experimenting with frames and forms. Now, I have a form on one site which when logged into logs into another site. Then I got thinking...
Basically, on my information site there is the basic login form (username/password) in the bottom frame. I use a top frame to describe my site. Rather than using target="_blank" to get another page to open I wanted the stats (member site) page to open in my top frame so they look as one site rather than two. They are two totally different URLS and I want to know if it is possible at all?
I tried using target="_parent" inside my form but it keeps opening a new page rather than opening in my main frame. Can you use the target command inside of forms?
Does anybody have any ideas at all?
I hope it all makes sense :)
Thanks in advance
Terry
I have never used that Javascript code. Here is a basic breakdown of the HTML that I use:
<form method="post" action="http://www.mymembershipsite.com/login.php">
<input type="text" name="username" size="12" maxlength="12" class="textbox">
<input type="password" name="password" size="12" maxlength="12" class="textbox">
<input type="reset" name="Reset" value="Reset" class="button">
<input type="submit" name="Submit2" value="Submit" class="button">
</form> Okay, This code is one the information site with the frames. I have placed it in the bottom frame. Basically, it is a fixed frame that has the login form to my other site to make it simpler to navigate rather than switching sites all the time. Once the details are entered I want to other site to open up in my top frame of the information site rather than a new window.
I tried breaking down the javascript code in many ways to fit into my form to open in my top frame but still no joy. If I had, for example, my two frames called mainframe.htm and bottomframe.htm then I used
<form method="post" action="http:www.whatever.com" onclick="javascript:parent.topframename.location.href="mainframe.htm">
This is basically the code I used to try to get it to work but I know only a little javascript so I'm a little miffed.
Please help...
Thank you
Terry
I wanted the stats (member site) page to open in my top frame
If you just want to load a different page in the top frame, then you need to do two things.
1. In the frameset document, within the frames tag for the top frame, declare a name for the top frame. Let's use name="display"
2. Then make sure that the link in your form (bottom frame) includes this attribute: target="display"
That should do it, and no javascript required.
However, I have run into another problem. When I click my 'back' button on my browser and click on my 'home' button on my web site the frame stays there. If I used target="_top" would this replace the two frames in my browser?
Thanks again
Terry
My login works fine and it opens in the top frame. I clicked 'back' in my browser and tried to load a page but the bottom frame stayed put.
Any ideas?
Cheers
Terry