How to auto submit form without using Submit button?

  • CHENW
    Asked on February 4, 2016 at 3:58 AM

    Eventually, I decided to prepopulate a form B to store only application status information when form A (the application) is submitted. This will allow the coordinator to edit form B without messing the data in form A.

    I had to redirect applicants through form A Thank You page. The applicants now have to Submit the prepoluated form B for no good reasons. If there is a way for jotform to automatically generate a form B when form A is created, please let me know.

  • BJoanna
    Replied on February 4, 2016 at 4:29 AM

    It is possible to auto submit prepopulated form. However you would need to use a full source code embed option. Inside of this guide you can find how to get the full source code of your form:

    http://www.jotform.com/help/104-How-to-get-your-Form-Source-Code 

    Then you can use the following script to auto submit your form on the page load:

    <script type="text/javascript">

    function formAutoSubmit () {

    var frm = document.getElementById("YourFormID");

    frm.submit();

    }

    window.onload = formAutoSubmit;

    </script>

    Where the YourFormID value should be replaced with your form ID.

    Other way is to use Global Countdown widget and set it to 1 second. 

    http://www.jotform.com/help/252-How-to-Add-a-Widget-to-your-Form 

    How to auto submit form without using Submit button? Image 1 Screenshot 20

    Here is my demo form: https://form.jotform.com/60342360558958 

    Hope this will help. Let us know if you need further assistance.

  • CHENW
    Replied on February 4, 2016 at 12:16 PM

    The global countdown timed the Coordinator out as well, lol!

    For the other method, I don't quite understand how it's done. So I'm using redirect method to pass three values from form A. Where do I insert the Java codes? If I insert the codes in form B then the coordinator won't be able to edit in the future.

    However, I do pass a code says "Applicant" when I redirect form A to form B. Could I set it up in a way that when it's "Applicant", the auto-submit codes will be activated (and the code "Applicant" is cleared) so by the time the Coordinator accesses the edit link, the form does not auto-submit?

    Thanks for being so patient with me!

  • BJoanna
    Replied on February 4, 2016 at 1:38 PM

    You are redirecting users from form A to prepopulated form B. With first method form must be embedded to your website with full source code. You would need to insert javascript code with full source code of your form to your webpage. This way your embedded form B will be automatically submitted. However your coordinator will be able to edit your form with direct edit link form Notification.

    Unfortunately if you add Global Countdown widget you will not be able to edit the form, because it will autosubmit. 

    I saw that all issues from your previous thread are resolved. Maybe it is better to use workaround from that thread. 

    Feel free to contact us if you have any other questions. 

  • CHENW
    Replied on February 4, 2016 at 1:49 PM

    Thanks for a prompt reply. I just got the conditional notifier issues ironed out so thanks to you the previous method you suggested is now working perfectly. I'm curious about this source code auto-submission method and will try it out at a later time. 

    Again, really appreciated your assistance!

  • BJoanna
    Replied on February 4, 2016 at 3:02 PM

    You're welcome. 

    Feel free to contact us if you have any other questions.