By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,521 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,521 IT Pros & Developers. It's quick & easy.

forms and frames

P: n/a
*** post for FREE via your newsreader at post.newsfeed.com ***

hello,

i have a pages that loads 2 frames, the top is a "does this look all
right?" frame with 2 links, yes and no. the bottom is the page the user
is looking at. the top also contains a form with information to be passed
to the next page. i can't figure out how to break out of the frame on a
submit. if that is unclear, here is a bit of code:

frame.html:

....
<FRAMESET ROWS="80,*" FRAMEBORDER="no" BORDER="0" FRAMESPACING="0">
<FRAME NAME="top" SCROLLING="no" NORESIZE SRC="join_2_1.php?<?php
echo $src; ?>" />
<FRAME NAME="main" SCROLLING="auto" SRC="<?php echo $SiteUrl; ?>" />
</FRAMESET>
....

join_2_1.php:

....
<SCRIPT>
function submitForm(formIndex) {
var form = document.forms[0];

if (formIndex == 0) {
form.action = "join3.php";
} else if (formIndex == 1) {
form.action = "join.php";
}
form.submit();
}
</SCRIPT>
....
<TABLE BORDER="0">
<TR>
<TD COLSPAN="2">Does your site look OK without violating our rules?
</TD>
</TR>
<TR>
<TD ALIGN="center">
<A TARGET="_top" HREF="javascript:submitForm(0);">YES</A>
</TD>
<TD ALIGN="center">
<A TARGET="_top" HREF="javascript:submitForm(1);">NO</A>
</TD>
</TR>
</TABLE>
<FORM METHOD="post" ACTION="join3.php">
<INPUT TYPE="hidden" NAME="ref" VALUE="<?php echo $ref; ?>" />
<INPUT TYPE="hidden" NAME="Name" VALUE="<?php echo $Name; ?>" />
<INPUT TYPE="hidden" NAME="Email" VALUE="<?php echo $Email; ?>" />
<INPUT TYPE="hidden" NAME="pass1" VALUE="<?php echo $pass1; ?>" />
<INPUT TYPE="hidden" NAME="pass2" VALUE="<?php echo $pass2; ?>" />
<INPUT TYPE="hidden" NAME="ViewEmail" VALUE="<?php echo $ViewEmail;
?>" />
<INPUT TYPE="hidden" NAME="SiteName" VALUE="<?php echo $SiteName;
?>" />
<INPUT TYPE="hidden" NAME="SiteUrl" VALUE="<?php echo $SiteUrl; ?>" />
<INPUT TYPE="hidden" NAME="SiteLanguage" VALUE="<?php echo
$SiteLanguage; ?>" />
</FORM>
....

when i click a link in the top frame, the next document that loads does
not break out of the frame. any ideas?

andrew
-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can use the TARGET attibute with a FORM to target the top frame.

Andrew Clark wrote:
*** post for FREE via your newsreader at post.newsfeed.com ***

hello,

i have a pages that loads 2 frames, the top is a "does this look all
right?" frame with 2 links, yes and no. the bottom is the page the user
is looking at. the top also contains a form with information to be passed
to the next page. i can't figure out how to break out of the frame on a
submit. if that is unclear, here is a bit of code:

frame.html:

...
<FRAMESET ROWS="80,*" FRAMEBORDER="no" BORDER="0" FRAMESPACING="0">
<FRAME NAME="top" SCROLLING="no" NORESIZE SRC="join_2_1.php?<?php
echo $src; ?>" />
<FRAME NAME="main" SCROLLING="auto" SRC="<?php echo $SiteUrl; ?>" />
</FRAMESET>
...

join_2_1.php:

...
<SCRIPT>
function submitForm(formIndex) {
var form = document.forms[0];

if (formIndex == 0) {
form.action = "join3.php";
} else if (formIndex == 1) {
form.action = "join.php";
}
form.submit();
}
</SCRIPT>
...
<TABLE BORDER="0">
<TR>
<TD COLSPAN="2">Does your site look OK without violating our rules?
</TD>
</TR>
<TR>
<TD ALIGN="center">
<A TARGET="_top" HREF="javascript:submitForm(0);">YES</A>
</TD>
<TD ALIGN="center">
<A TARGET="_top" HREF="javascript:submitForm(1);">NO</A>
</TD>
</TR>
</TABLE>
<FORM METHOD="post" ACTION="join3.php">
<INPUT TYPE="hidden" NAME="ref" VALUE="<?php echo $ref; ?>" />
<INPUT TYPE="hidden" NAME="Name" VALUE="<?php echo $Name; ?>" />
<INPUT TYPE="hidden" NAME="Email" VALUE="<?php echo $Email; ?>" />
<INPUT TYPE="hidden" NAME="pass1" VALUE="<?php echo $pass1; ?>" />
<INPUT TYPE="hidden" NAME="pass2" VALUE="<?php echo $pass2; ?>" />
<INPUT TYPE="hidden" NAME="ViewEmail" VALUE="<?php echo $ViewEmail;
?>" />
<INPUT TYPE="hidden" NAME="SiteName" VALUE="<?php echo $SiteName;
?>" />
<INPUT TYPE="hidden" NAME="SiteUrl" VALUE="<?php echo $SiteUrl; ?>" />
<INPUT TYPE="hidden" NAME="SiteLanguage" VALUE="<?php echo
$SiteLanguage; ?>" />
</FORM>
...

when i click a link in the top frame, the next document that loads does
not break out of the frame. any ideas?

andrew

-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----


Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.