How to close a form

Discussion in 'HTML' started by Steven Malcolm, Mar 2, 2004.

  1. Hello

    I am totally new to HTML.

    What I need is a way to close a form, i have already tried to use code like

    <form>
    <input type="button" value="Close Window" onClick="self.close()">
    </form>

    But this brings another little form saying that the form is trying to close
    the window.

    What I need is a button, but oes not ask if you want to close the for, just
    closes.


    TIA


    Steven
     
    Steven Malcolm, Mar 2, 2004
    #1
    1. Advertising

  2. Steven Malcolm

    Mark Parnell Guest

    On Tue, 2 Mar 2004 16:28:14 +1100, "Steven Malcolm"
    <> declared in alt.html:

    > What I need is a way to close a form


    </form>

    > But this brings another little form saying that the form is trying to close
    > the window.


    So you actually want to close the window, not a form. See that X in the
    top right-hand corner of the window? That's what that is for.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Mar 2, 2004
    #2
    1. Advertising

  3. Steven Malcolm

    dave conz Guest

    Steven Malcolm wrote:

    > Hello
    >
    > I am totally new to HTML.
    >
    > What I need is a way to close a form, i have already tried to use code like
    >
    > <form>
    > <input type="button" value="Close Window" onClick="self.close()">
    > </form>
    >
    > But this brings another little form saying that the form is trying to close
    > the window.
    >
    > What I need is a button, but oes not ask if you want to close the for, just
    > closes.
    >
    >
    > TIA
    >
    >
    > Steven
    >

    The alert you are seeing is a browser function, quite rightly informing
    the user that something on the page is trying to close the window. You
    cannot change it.
    -dave
    -------------------
    http://www.mediacollege.com - Free video & electronic media resources
     
    dave conz, Mar 2, 2004
    #3
  4. Steven Malcolm

    SpaceGirl Guest

    "dave conz" <> wrote in message
    news:vSV0c.7765$...
    > Steven Malcolm wrote:
    >
    > > Hello
    > >
    > > I am totally new to HTML.
    > >
    > > What I need is a way to close a form, i have already tried to use code

    like
    > >
    > > <form>
    > > <input type="button" value="Close Window"

    onClick="self.close()">
    > > </form>
    > >
    > > But this brings another little form saying that the form is trying to

    close
    > > the window.
    > >
    > > What I need is a button, but oes not ask if you want to close the for,

    just
    > > closes.
    > >
    > >
    > > TIA
    > >
    > >
    > > Steven
    > >

    > The alert you are seeing is a browser function, quite rightly informing
    > the user that something on the page is trying to close the window. You
    > cannot change it.
    > -dave



    Yes you can :) If the browser window was "created" (popped-up) by a script,
    then the the window.close(); event will not trigger the message if the child
    window or the parent window triggers the event... But if it's a regular
    window, you cant avoid the message.
     
    SpaceGirl, Mar 2, 2004
    #4
    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. Denon
    Replies:
    1
    Views:
    593
    Saravana [MVP]
    Nov 14, 2003
  2. Daniel Albisser
    Replies:
    1
    Views:
    1,130
    GaryM
    Apr 7, 2004
  3. Paul van Rossem
    Replies:
    0
    Views:
    615
    Paul van Rossem
    Apr 7, 2005
  4. Replies:
    6
    Views:
    8,900
    sateeshranga
    Aug 7, 2008
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    918
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page