how to submit iframed form to top or whole window

Discussion in 'Javascript' started by Sharkie, May 23, 2008.

  1. Sharkie

    Sharkie Guest

    I have a document with couple of iframes. One of the iframes has a
    simple form. When this form is submitted
    I would like to display the results in whole (top) window as opposed
    to just in the originating iframe.

    Form is submitted to a servlet which returns new html page.

    How can this be done?

    In case of links I can do this by either specifying "_top" target, or
    this onclick handler:
    top.location=this.href;return false;

    Works perfectly, but I can't make it work for form submit. I tried
    executing this:
    top.location=self.location;

    both before the form submit and after, but neither works. I mean the
    iframe does open in whole window,
    but if executed before the submit, form will never get submitted, and
    after the submit I lose the results.

    Any help much appreciated.
     
    Sharkie, May 23, 2008
    #1
    1. Advertising

  2. Sharkie wrote:
    > In case of links I can do this by either specifying "_top" target,


    As you can with forms.

    http://www.w3.org/TR/html401/interact/forms.html#edef-FORM


    PointedEars
    --
    realism: HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness: XHTML 1.1 as application/xhtml+xml
    -- Bjoern Hoehrmann
     
    Thomas 'PointedEars' Lahn, May 23, 2008
    #2
    1. Advertising

  3. Sharkie

    Sharkie Guest

    On May 23, 2:21 pm, Thomas 'PointedEars' Lahn <>
    wrote:
    > Sharkie wrote:
    > > In case of links I can do this by either specifying "_top" target,

    >
    > As you can with forms.
    >
    > http://www.w3.org/TR/html401/interact/forms.html#edef-FORM


    Thanks, didn't know that. I actually searched for "_top" in the above
    document,
    didn't find it, and thought it's not supported.

    Should have searched for "target" instead...
     
    Sharkie, May 27, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    6,253
  2. Robert Oschler
    Replies:
    0
    Views:
    84
    Robert Oschler
    Sep 6, 2005
  3. zalun
    Replies:
    3
    Views:
    91
    Thomas 'PointedEars' Lahn
    Mar 22, 2006
  4. Replies:
    5
    Views:
    114
    shimmyshack
    Jun 27, 2007
  5. Freshman

    Reload two iframes on one iframed page!

    Freshman, Jan 5, 2010, in forum: Javascript
    Replies:
    8
    Views:
    163
    Freshman
    Jan 5, 2010
Loading...

Share This Page