forms and frames

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Clark

    forms and frames

    *** post for FREE via your newsreader at post.newsfeed.c om ***

    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.p hp?<?php
    echo $src; ?>" />
    <FRAME NAME="main" SCROLLING="auto " SRC="<?php echo $SiteUrl; ?>" />
    </FRAMESET>
    ....

    join_2_1.php:

    ....
    <SCRIPT>
    function submitForm(form Index) {
    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">Doe s your site look OK without violating our rules?
    </TD>
    </TR>
    <TR>
    <TD ALIGN="center">
    <A TARGET="_top" HREF="javascrip t:submitForm(0) ;">YES</A>
    </TD>
    <TD ALIGN="center">
    <A TARGET="_top" HREF="javascrip t:submitForm(1) ;">NO</A>
    </TD>
    </TR>
    </TABLE>
    <FORM METHOD="post" ACTION="join3.p hp">
    <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="SiteLangu age" 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! =-----

  • Greg Griffiths

    #2
    Re: forms and frames

    You can use the TARGET attibute with a FORM to target the top frame.

    Andrew Clark wrote:
    [color=blue]
    > *** post for FREE via your newsreader at post.newsfeed.c om ***
    >
    > 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.p hp?<?php
    > echo $src; ?>" />
    > <FRAME NAME="main" SCROLLING="auto " SRC="<?php echo $SiteUrl; ?>" />
    > </FRAMESET>
    > ...
    >
    > join_2_1.php:
    >
    > ...
    > <SCRIPT>
    > function submitForm(form Index) {
    > 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">Doe s your site look OK without violating our rules?
    > </TD>
    > </TR>
    > <TR>
    > <TD ALIGN="center">
    > <A TARGET="_top" HREF="javascrip t:submitForm(0) ;">YES</A>
    > </TD>
    > <TD ALIGN="center">
    > <A TARGET="_top" HREF="javascrip t:submitForm(1) ;">NO</A>
    > </TD>
    > </TR>
    > </TABLE>
    > <FORM METHOD="post" ACTION="join3.p hp">
    > <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="SiteLangu age" 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! =-----
    >[/color]

    Comment

    Working...