little frame help please

liunx

Guest
hello i'm having a small problem with one of my pages over all there is 5 frames and all i'm wanting to change of the 5 are 3 of them...it's for a form and there is a cancel button that will take the person back to the original page...but as it is now when the cancel button is pressed and ok'ed to cancel it only changes the frame that the form is in...i'll attach a pic to better show what it is i'm meaning...if you look at the pic what i'm wanting is for the cancel button to change what is in the frames that are outlined in green...the 2 frames that are in the red never change no matter what page the visitor will be viewing...here is the code for what i have on the form page (of course w/o the user/pass info lol)<br />
<br />
<br />
<html><br />
<br />
<head><br />
<title></title><br />
<base target="content"><br />
<script> <br />
function cancel_it() { <br />
var okay = confirm('Canceling will return you to our home page.'); <br />
<br />
if (okay == true) { <br />
window.location.href=http://www.htmlforums.com/archive/index.php/"../index2.html"; } <br />
} <br />
</script><br />
</head><br />
<br />
<body background="../tourney/bluedream.jpg" bgproperties="fixed"><br />
<br />
<br />
<br />
<p align="center"><br />
<br><br />
<b>Hello we would like to get to know a little more about you.<br><br />
NOTE: None of this information is required so put in as much or little you would<br />
like to.</b></p><br />
<br />
<form name="profile" method="post" action="contact.php"><br />
<hr color="#FFFF00" width="500" align="center"><br />
<div align="center"><div align="center"><center><table border="0"<br />
cellpadding="0" cellspacing="0" width="75%"><br />
<tr><br />
<td width="55%" nowrap valign="top"><b>Real Name:<br><br />
</b> <input type="text" name="name" size="17"<br />
maxlength="16" style="color: #00FF00; background-color: rgb(0,0,255)"> <br><br />
<b>Gender:<br><br />
</b><input type="text" name="Gender" size="10"<br />
style="background-color: rgb(255,0,0); color: #FFFF00"><br><br />
<strong>Age</strong><b>:<br><br />
</b><input type="text" name="Age" size="3"<br />
style="background-color: #0000FF; color: #FFFFFF"><br><br />
<b>Location:<br><br />
<input type="text" name="location" size="20" style="background-color: #000080; color: #FFFFFF"><br />
</b></td><br />
<td width="45%" valign="top"><b>Hobbies:<br><br />
<textarea rows="3" name="hobbies" cols="40" style="background-color: #000000; color: #FF0000"></textarea><br><br />
Why you like hosting:<br><br />
<textarea rows="3" name="why_i_like_hosting" cols="40" style="background-color: #C0C0C0; color: #0000FF"></textarea><br />
</b><br />
</td><br />
</tr><br />
<tr><br />
<td width="55%" valign="top"><b>Games you like on the zone:<br><br />
<textarea rows="3" name="games_i_play" cols="40" style="background-color: #D6CE41; color: #8339BF"></textarea><br><br />
Other nics that I maybe found using:<br><br />
<textarea rows="3" name="other_nics" cols="40" style="background-color: #FF0000; color: #FFFFFF"></textarea></b><br />
</td><br />
<td valign="top" width="45%"><b>Misc. info I would like<br />
to share</b><br><br />
<textarea name="misc_info" rows="10" cols="40"<br />
style="background-color: rgb(128,0,128); color: rgb(255,255,255)"></textarea><br />
</td><br />
</tr><br />
</table><br />
<br><br />
<input type="submit" value="Send"> <input type="reset" value="Start Over"> <input<br />
type="button" value="Cancel" onClick="javascript:cancel_it();"> </center></div><br />
<dd><br><br />
<hr color="#FFFF00" width="500"><br />
</dd><br />
</div><br />
</form><br />
<br />
<p align="center"><br><br />
</p><br />
<?<br />
// at the bottom of the page add this<br />
<br />
} else {<br />
header("location: index.php");<br />
}<br />
?><br />
</body><br />
</html><br />
<br />
<br />
now the cancel function does work just fine...BUT it dont take over the 3 frames that i'm wanting...take a look at the attached pic to see what i mean to see more in detail what i want<br />
<br />
thanks all for the help<!--content-->stupid pic didn't go with the last post...oh well here it is<!--content-->what's going on is that when you call "window." from a frame then it will refer to the frame as the window object...<br />
<br />
if you add "top." to the "window." line then it will start from the browser window itself and go from there...<br />
<br />
if you add "parent." to the "window." line then it will start from the frame above the frame that your js code is in and go from there...<br />
<br />
if you want to change manually only those 3 frames without haveing the other 2 frames loaded, use something like this modification:<br />
<br />
if (okay == true) { <br />
top.leftTopGreenFrame.window.location.href=http://www.htmlforums.com/archive/index.php/"newleftTopGreenpage.html";<br />
top.leftBottomGreenFrame.window.location.href=http://www.htmlforums.com/archive/index.php/"newleftBottomGreenpage.html";<br />
window.location.href=http://www.htmlforums.com/archive/index.php/"newPageToLoadInThisSameFrame.html"; <br />
} <br />
<br />
or if you just want to change everything in the whole browser window to a new page then use:<br />
<br />
top.window.location="whereDoYouWantToGoToday.html";<!--content-->ok so what your saying is..the frame i'm wanting to change (the frame that contains the 3) is called content so i should put content.window.location.href=http://www.htmlforums.com/archive/index.php/"../index2.html??<br />
<br />
------------------------------------------------------------<br />
<br />
the frame named content is the frame that contains the 3 that are marked with the green outline in the pic...and is what i'm wanting to change<br />
<br />
------------------------------------------------------------<br />
sigh editing again lol...the effect i'm wanting to get is going from what you see in that pic to what you see on this addy <!-- m --><a class="postlink" href="http://disney.zonehosts.com">http://disney.zonehosts.com</a><!-- m --> if they decide to cancel the form...i have it so it will work when it is submitted just not when canceled<!--content-->well i got it...thanks for the help...i tried content with that being the name of the frame that the 3 frames i wanted to change were sitting in but i had to use parent altho i thought that would change the whole page but it didn't only that one frame (the content frame from the main page)<!--content-->
 
Back
Top