Submit button to also close popup form

Discussion in 'HTML' started by Neil, Dec 6, 2005.

  1. Neil

    Neil Guest

    Is there a way to close a popup form using the same submit button, rather
    than the form loosing control to the submit destination?

    Or can a submit button send my form to a URL of my choice?

    suggestions appreciated.
    Neil, Dec 6, 2005
    #1
    1. Advertising

  2. Neil

    Moneypenny Guest

    You can make a little javascript function who close the popup in 2 seconds
    afther the submit.

    like:

    <form action="blaat.php" onSubmit="close_window()">
    ........
    </form>



    "Neil" <> schreef in bericht
    news:Kjilf.15376$...
    > Is there a way to close a popup form using the same submit button, rather
    > than the form loosing control to the submit destination?
    >
    > Or can a submit button send my form to a URL of my choice?
    >
    > suggestions appreciated.
    >
    >
    Moneypenny, Dec 6, 2005
    #2
    1. Advertising

  3. Neil

    Neil Guest

    Thanks for the reply

    I'm not real clear on how to apply this and syntax.
    Would the "blaat.php" be my submit to destination on the server?

    This is the OnSubmit line from my form(close_window() added):

    <form onsubmit="return validate()" "close_window()" name="smsform"
    id="smsform"
    action="http://sms.relay.com/send/sms" method="GET">

    It didn't close the window when tested. Do I need a separator between
    onsubmit items, or two onSubmits?
    Is close_window() a function I must create?

    Do I need a <script type="text/javascript"> before your example, and
    </script> after?

    Thanks



    "Moneypenny" <> wrote in message
    news:43960503$0$2340$...
    > You can make a little javascript function who close the popup in 2 seconds
    > afther the submit.
    >
    > like:
    >
    > <form action="blaat.php" onSubmit="close_window()">
    > .......
    > </form>
    >
    >
    >
    > "Neil" <> schreef in bericht
    > news:Kjilf.15376$...
    > > Is there a way to close a popup form using the same submit button,

    rather
    > > than the form loosing control to the submit destination?
    > >
    > > Or can a submit button send my form to a URL of my choice?
    > >
    > > suggestions appreciated.
    > >
    > >

    >
    >
    Neil, Dec 8, 2005
    #3
  4. Neil

    Guillaume Guest

    Neil:
    > I'm not real clear on how to apply this and syntax.
    > Would the "blaat.php" be my submit to destination on the server?
    > This is the OnSubmit line from my form(close_window() added):
    > <form onsubmit="return validate()" "close_window()" name="smsform"
    > id="smsform"
    > action="http://sms.relay.com/send/sms" method="GET">
    >
    > It didn't close the window when tested. Do I need a separator between
    > onsubmit items, or two onSubmits?
    > Is close_window() a function I must create?
    > Do I need a <script type="text/javascript"> before your example, and
    > </script> after?


    I use to put the javascript code in the targeted page, not in the form.
    If this is an option...

    <script language="javascript"><!--//
    window.close();
    //--></script>

    --
    Advertize your site
    http://www.milliondollarscreenshot.com/
    Guillaume, Dec 8, 2005
    #4
  5. Neil

    Neil Guest

    I don't have access to the page displayed after submit..
    I really thought there was a way to close my own popup browser window, after
    submit.

    "Guillaume" <> wrote in message
    news:dn9afk$75r$.9tel.net...
    > Neil:
    > > I'm not real clear on how to apply this and syntax.
    > > Would the "blaat.php" be my submit to destination on the server?
    > > This is the OnSubmit line from my form(close_window() added):
    > > <form onsubmit="return validate()" "close_window()" name="smsform"
    > > id="smsform"
    > > action="http://sms.relay.com/send/sms" method="GET">
    > >
    > > It didn't close the window when tested. Do I need a separator between
    > > onsubmit items, or two onSubmits?
    > > Is close_window() a function I must create?
    > > Do I need a <script type="text/javascript"> before your example, and
    > > </script> after?

    >
    > I use to put the javascript code in the targeted page, not in the form.
    > If this is an option...
    >
    > <script language="javascript"><!--//
    > window.close();
    > //--></script>
    >
    > --
    > Advertize your site
    > http://www.milliondollarscreenshot.com/
    Neil, Dec 8, 2005
    #5
  6. Neil

    euqrop

    Joined:
    Aug 14, 2007
    Messages:
    1
    it's simple after the buton submit value ="" add onclick="self.close()"
    euqrop, Aug 14, 2007
    #6
  7. Neil

    atilio123321

    Joined:
    Sep 2, 2011
    Messages:
    1
    Hi every one this the answer i found it works for me

    first i open a new popup window with the form to fill includding a PHP that set a variable
    $run = 0 ; and once is filled i submitted to itself and trough PHP if statement i'm able to catch those values and insert it on the database , then i reset the variable run like this
    $run = 3 ;
    and at the end of the file i run this php if satatment one more time
    <?PHP if( $run == 3) { echo ' <body onload="self.close()"> ' ;} ?>
    i hope that works for you guys and my appologies for my english :)))
    atilio123321, Sep 2, 2011
    #7
    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. Daniel Albisser
    Replies:
    1
    Views:
    1,070
    GaryM
    Apr 7, 2004
  2. Replies:
    2
    Views:
    6,184
  3. Iñaki Baz Castillo
    Replies:
    7
    Views:
    839
    Iñaki Baz Castillo
    Jan 12, 2010
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    510
    Randy Webb
    Jun 19, 2004
  5. Replies:
    2
    Views:
    349
Loading...

Share This Page