What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Popup "Thank You" page

    Asked by rapolinario on February 24, 2013 at 02:23 PM

    Hy

    I needed the Thank You page to open in a popup window, so I did the steps you explained at http://www.jotform.com/answers/181798-Is-there-a-way-to-ceate-a-pop-up-thank-you-message-when-a-form-is-submitted-This-way-the-user-can-simply-close-the-pop-up-window-go-back-to-site-

    I've done all these steps in my form and my problem is that, even though my form wasn't filled, the thank you page kept poping when i pressed enter ou the submit button... is there a way to open the thnak you page ONLY when the form is properly filled?

    Thank you

    Rui Apolinário

    Page URL:
    http://www.ruiapolinario.com/extras/progresso/contactos.php

  • Profile Image
    JotForm Support

    Answered by jonathan on February 24, 2013 at 04:20 PM

    Hi Rui,

    From what I have seen so far on your website's source code, the problem had to do with you form's source code embed.

    I suggest you try to clear first all the form's code in your website. Then, generate the code again and re-embed in your website.

    After you have re-embedded a clean form's source code, test it first.

    If the default source code is working fine, then you can add the custom scripts for the pop-up then test again.

    Please keep us posted of the results.

    Thanks.

  • Profile Image

    Answered by Sidharth Choudhary on February 24, 2013 at 04:48 PM
    Hey,
    Your current approach to open the PopUp window is correct but the only issue is that it opens in bot the conditions (mandatory fields are filled or not)
    To me it looks that your approach shoud be something like this:
    1. On submit of the form you fire a javascript function ValidateForm
    2. In this function you add some condition like checking the values of the textboxes.
    3. If the conditions are satisfied you open the PopUp window
    Here is the code which should give you the idea on what your approach should be:
     
    <script type="text/javascript">     function validateForm(url, w, h) {
             var left = (screen.width / 2) - (w / 2); var top = (screen.height / 4) - (h / 4);
             var nomeCompleto = document.forms["form_30546588620458"]["q9_nomeCompleto"].value;
             var moradaDe3 = document.forms["form_30546588620458"]["q3_moradaDe3"].value;
             var telefone = document.forms["form_30546588620458"]["q4_telefone"].value;
             var assunto8 = document.forms["form_30546588620458"]["q8_assunto8"].value;
             var mensagem = document.forms["form_30546588620458"]["q5_mensagem"].value;
             var captcha = document.forms["form_30546588620458"]["captcha"].value;
             if (nomeCompleto == null || nomeCompleto == "" ) {
                 //alert("nomeCompleto Required");
                 //return false;
                 // or Just do nothing here
             }
             else {
                 newwindow = window.open(url, 'title', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); if (window.focus) { newwindow.focus() } return false;
                             
             }  
         }
       </script>
  • Profile Image

    Answered by rapolinario on February 24, 2013 at 09:24 PM

    Thank you for your answers.

    Using the code that Sidharth gave (thank you Sidharth!) it solved the problem of the popup. It only shows the popup when all the conditions are satisfied (even though the email box verification isn't checking if there is a valid email adress or not).

    My problem now (and i've cleaned the code as much as i could) is that the thank you page (that i inserted when making the form) is still showing on the main page. I can´t find any reason for the submition not to send it to the iframe...

    If you see any reason for that, I would be very thankfull :)

    Thanks

  • Profile Image
    JotForm Support

    Answered by EltonCris on February 25, 2013 at 01:53 AM

    @rapolinario

    I just change your form thank you page in the Form Builder from Custom URL to Default. It should now be fine. Thanks! :)

  • Profile Image

    Answered by rapolinario on February 25, 2013 at 08:17 AM

    Yeah! Now it's working perfectly.

    Thank you for the support!!

  • Profile Image
    JotForm Support

    Answered by EltonCris on February 25, 2013 at 08:25 AM

    Glad it helps. Cheers!

  • Profile Image

    Answered by rapolinario on February 25, 2013 at 06:51 PM

    Just one final question.

    I've noticed that after submission, the submit button doesn't reapear...
    The text that substitutes the button (used to be "Please wait...") stay's there. 
    I checked the properties of the form and it has no submissions limit. 

    Is there a way to refresh the page after submission so the button re-apears?

    Thank you

  • Profile Image
    JotForm Support

    Answered by EltonCris on February 26, 2013 at 02:36 AM

    @rapolinario

    Try removing the form-submit-button class on your form's source code might fixed it. Check this screen.

    Thank you!

  • Profile Image

    Answered by rapolinario on February 26, 2013 at 06:18 PM

    Yeah! That did it!

    Thank you!

  • Profile Image
    JotForm Support

    Answered by EltonCris on February 26, 2013 at 07:27 PM

    Welcome. Cheers!