Target for form to open in same window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon Wigzell

    Target for form to open in same window

    I just want my form target to be another page but open it in the same
    window. Here is my code for the 2 pages :

    -------------------------------form1.htm------------------------------------
    <html>
    <body>
    This is form 1
    <form ACTION="form2.h tm" METHOD="POST" target="self">
    <input type="submit" value="Submit">
    </form>
    </body>
    </html>
    -------------------------------form2.htm------------------------------------
    <html>
    <body>
    This is form 2
    <form ACTION="form1.h tm" METHOD="POST" target="self">
    <input type="submit" value="Submit">
    </form>
    </body>
    </html>
    ----------------------------------------------------------------------------
    --

    You'd think the same window would just switch pages back and forth as you
    clicked the submit buttons but it doesn't work. Not only does the new form
    open in a seperate window but it then claims that it is an invalid address
    and won't display the page.





    This is a stripped down example. I actually have a series of forms, the
    acatual forms that come up are determined by the choices the user makes
    within the previous forms. It is all working fine if I open separate windows
    for each form/page but I'd prefer if they just opened in the same window.

    What simple thing have I missed here? Thanks!




  • Andrew Thompson

    #2
    Re: Target for form to open in same window

    On Mon, 14 Jun 2004 15:11:01 GMT, Simon Wigzell wrote:
    [color=blue]
    > <form ACTION="form2.h tm" METHOD="POST" target="self">[/color]

    You did not validate this as HTML, did you?
    <http://www.w3.org/TR/1999/REC-html401-19991224/types.html#idx-target_frame>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology

    Comment

    • David Dorward

      #3
      Re: Target for form to open in same window

      Andrew Thompson wrote:
      [color=blue]
      > On Mon, 14 Jun 2004 15:11:01 GMT, Simon Wigzell wrote:
      >[color=green]
      >> <form ACTION="form2.h tm" METHOD="POST" target="self">[/color]
      >
      > You did not validate this as HTML, did you?
      >[/color]
      <http://www.w3.org/TR/1999/REC-html401-19991224/types.html#idx-target_frame>

      Validating would not help in this case.

      (a) The DTD does not express the rules for frame target names
      (b) "self" is a valid frame target name (it has a different meaning to
      "_self", but is still acceptable)

      --
      David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
      Home is where the ~/.bashrc is

      Comment

      • Andrew Thompson

        #4
        Re: Target for form to open in same window

        On Mon, 14 Jun 2004 22:06:19 +0100, David Dorward wrote:
        [color=blue]
        > (b) "self" is a valid frame target name (it has a different meaning to
        > "_self", but is still acceptable)[/color]

        ...uggh! (slaps forehead) Good point.

        (grumbles) Knew I shoulda' just called for
        a link and been done with it, but no, I had
        to be 'clever' as well..

        --
        Andrew Thompson
        http://www.PhySci.org/ Open-source software suite
        http://www.PhySci.org/codes/ Web & IT Help
        http://www.1point1C.org/ Science & Technology

        Comment

        Working...