how to close pop up page after email form has been submitted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #16
    ... yes of course ... all nodes that should be displayed by the browser has to be located within the documents body ... ;)

    ... i cannot reproduce your next question ... the code works fine here ... for testing purpose try to set style='display: none' to your form and have a look whether it is hidden or not ...

    kind regards

    Comment

    • karen987
      New Member
      • Mar 2007
      • 114

      #17
      Originally posted by gits
      ... yes of course ... all nodes that should be displayed by the browser has to be located within the documents body ... ;)

      ... i cannot reproduce your next question ... the code works fine here ... for testing purpose try to set style='display: none' to your form and have a look whether it is hidden or not ...

      kind regards
      #

      Ok when i added this as you suggested to the form tag:

      Code:
      <form action="mailto:me@web.com" method="POST" enctype="multipart/form-data" id="my_form" name="pledgeForm" style='display:none'>
      i submitted the form. The text shows, but the thank you message didn't show.

      i'm thinking it may be just easier to close the window on submit, and a thank you comes in a small pop up afterwards for 3 seconds and closes by itself, would this be quicker?

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #18
        you see the form with adding the style display:none? ... before submit? then it will not work ... i would need your entire html to test it out ... may be its due to something with your table (i am pretty sure) ... i wouldn't recommend more popups ... we will find it out ... you may pm me your entire html-file ... until the thread will get too long ... i'll post the relevant things here after having a look at it ...

        kind regards

        Comment

        • karen987
          New Member
          • Mar 2007
          • 114

          #19
          Gits,

          I've solved it now, Apparently it was a div tag close or something, that was missing. Here is the code, that works, just in case you have a similar problem yourself ever. THe missing div is in line 25 and it's at the end of the "form action" tag

          Thanks for all your help.

          Code:
          <html><head> 
              <title>title</title> 
              <link rel="STYLESHEET" type="text/css" href="styles.css"> 
                  <STYLE TYPE="text/css"> 
          <!-- 
          body {scrollbar-base-color: #4169E1} 
          --> 
                  </STYLE> 
          
          
               <script> 
                      function toggle_display() { 
                          var form   = document.getElementById('my_form'); 
                          var thanks = document.getElementById('THANKS'); 
                          form.style.display ='none'; 
                          thanks.style.display='block'; 
                      } 
                  </script> 
              </head>     
              <body> 
          <div id="THANKS" style="display:none;"> 
                      Thank you for making this pledge. 
                      <a href="#" onClick="window.close();">Close</a> 
          </div> 
          <form action="mailto:me@web.com" method="POST" enctype="multipart/form-data" id="my_form" name="pledgeForm" style="display:block;">   [B]     </div> [/B] 
          <table width="538" align="center"> 
          the form content is here, and the bottom of the form is as below 
          
          <tr><td align="left"><input type="submit" value="Email This Form" onClick="toggle_display();"/></td> </tr> 
                 
          </table>   
            </form> 
              </body> 
          </html>

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #20
            hi ...

            it was not a missing div ... i looked over your code ... it was the invalid markup:

            - table-end-tag was missing
            - tags mustn't overlap
            - table should be entirely within the form

            ... glad you find it out but be aware with the markup next time ;)

            kind regards ...

            Comment

            • kovik
              Recognized Expert Top Contributor
              • Jun 2007
              • 1044

              #21
              In regards to the original question, it is possible to close a window remotely.

              [code=javascript]var popup = window.open();
              popup.close()[/code]

              Comment

              • karen987
                New Member
                • Mar 2007
                • 114

                #22
                Hi Vole

                thank you,

                What do you mean remotely? Should i add this code to the page i want to close or it's parent or what?

                thanks

                Comment

                • kovik
                  Recognized Expert Top Contributor
                  • Jun 2007
                  • 1044

                  #23
                  Remotely means from the page that created the popup. You can make a window close itself by just using window.close().

                  Comment

                  • wgale025
                    New Member
                    • Feb 2007
                    • 23

                    #24
                    try this
                    [HTML]<script>self.op ener=null;self. close();</script>[/HTML]
                    if your browser is not ie7

                    Comment

                    Working...