I am using frames (don't ask why I just am), and what I want to do is when a user clicks a button on "frame 2" it'll redirect them to another page, AND when they click the button, "frame 1" will change to another page as well. How do I come about doing this?
changing urls when submiting a form (frames)
Started by derek.sullivan, Jan 21 2008 11:39 PM
6 replies to this topic
#1
Posted 21 January 2008 - 11:39 PM
#2
Posted 22 January 2008 - 10:40 AM
You have to have another HTML document that contains the two desired pages in a different FRAMESET. Then have the link in "frame 2" refer to '_parent' in its target attribute rather than the name of a frame.
Derek, on Jan 21 2008, 08:39 PM, said:
I am using frames (don't ask why I just am), and what I want to do is when a user clicks a button on "frame 2" it'll redirect them to another page, AND when they click the button, "frame 1" will change to another page as well. How do I come about doing this?
#3
Posted 22 January 2008 - 12:18 PM
ok that kind of CONFUSED ME ALOT! please restate the reply.
#4
Posted 22 January 2008 - 08:48 PM
<INPUT TYPE="submit" TARGET="_parent">
Is this what you mean?
#5
Posted 23 January 2008 - 12:35 PM
Here is an example of what I mean... Im in frame 2 (the form area), there is another frame above it. When I click submit, it'll not only take me to another page in frame 2 (the form area), but also will relocate me to another page in the above frame.
#6
Posted 23 January 2008 - 04:38 PM
Ignore my previous comment anyway, I must've been tired! I think I understand more clearly now though (target should've been specified in form tag, not input).
For your submit button, make it something like:
<INPUT TYPE="submit" ONCLICK="parent.frame1.location.href='newpage.html'">
I think this javascript implementation should work? It will submit the form data to frame2 (frame2 being the form, and it loading to self by default) and then load newpage.html in frame1 - or did you want the form data to be submitted to two different pages each in a different frame?
Javascript isn't ideal - though to my knowledge it's the most practical solution to what I see as your problem
For your submit button, make it something like:
<INPUT TYPE="submit" ONCLICK="parent.frame1.location.href='newpage.html'">
I think this javascript implementation should work? It will submit the form data to frame2 (frame2 being the form, and it loading to self by default) and then load newpage.html in frame1 - or did you want the form data to be submitted to two different pages each in a different frame?
Javascript isn't ideal - though to my knowledge it's the most practical solution to what I see as your problem
#7
Posted 24 January 2008 - 10:28 PM
well, i figured it out and javascript is ideal....
for futre refrence it's something like this
<script language="Javascript">
function changeWindows() {
parent.frame1.location = '';
parent.frame2.location = '';
}
</script>
Then run your function!
for futre refrence it's something like this
<script language="Javascript">
function changeWindows() {
parent.frame1.location = '';
parent.frame2.location = '';
}
</script>
Then run your function!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
