How to call callback-function after finishing loading embedded form?

  • linxdatacenter
    Asked on June 24, 2019 at 4:28 AM

    Hi,

    Occasionally, We solve our tasks by using source code of forms with some JavaScript snippets. But we have forms that require often changes, so, we need to re-download source code, change it on our server, check if code works fine, and after that continue to use our form. It is very uncomfortable way to manage our business. I thought, may be we don't need to use entire source code of form, but only embedding way with some JavaScript wrapper. But I couldn't find any solution to wait until form finishing loading and after that use our code. Is there any way to do it? It would be very useful functionality that can help many people to make complex applications conveniently based on JotForm. 

  • roneet
    Replied on June 24, 2019 at 8:55 AM

    Can you please elaborate on your requirements? We currently do not support the callback you mentioned but this is how we inject webhook to know the form submission and other properties.

    1. You can use webhook that sends data to your own server 

    https://www.jotform.com/help/245-How-to-Setup-a-Webhook-with-JotForm 

    https://www.jotform.com/help/248-Webhook-PHP-Script-Examples 

     

    This will allow you to receive notice when a submission is made, and perform your actions with that data within your system.

    2. You can use our API to check the form properties for yourself, and see when your form was last saved.

    Let us know if you need more assistance.

    Thanks!



  • linxdatacenter
    Replied on June 25, 2019 at 5:17 AM

    Thank you, for your response.

    I will try to explain my needs. I want to use embedded form by pasting this code into my local index.html file, that initializes loading of form on the page : <script type="text/javascript" src="https://form.jotformeu.com/jsform/some_form_id"></script>

    The process of loading form is asynchronous, so, waiting of ending of this process caused me some difficulties. After loading, certain javascript must be launched in order to gain access to the source code of the loaded form.

    If you suggest me some solution of this problem I would be very grateful.

  • Jed_C
    Replied on June 25, 2019 at 6:20 AM

    1) After loading, certain javascript must be launched in order to gain access to the source code of the loaded form. — 

    To clarify, you want to use the script embed code so you don't have to change the source code every time? Currently, you are using the source code to load Jotform. 

    What difficulties are you encountering when using the script code? Also, I'm not sure what you mean by "certain javascript must be launched in order to gain access to the source code of the loaded form".

    Here's how I understand your workflow:

    1). Jotform embed code is loaded in your index.html or main page

    2). Once you loaded the page, you have some Javascript that loads and it access your embedded Jotform

    What is the purpose of those JS accessing your embedded Jotform? What are your goals?

    Looking forward for your response. 

  • linxdatacenter
    Replied on June 25, 2019 at 7:21 AM

    To clarify, you want to use the script embed code so you don't have to change the source code every time? Currently, you are using the source code to load Jotform.  - Correct. e.g. If I added new field to form or changed some tittle, I have to download source code of form, replace it in main file on server and add my js script. I want to simplify this workflow.

    We have different goals for internal needs of our company. Hard to give you some example. It is all about customizing and expanding functionality of forms, little changes of structure based on input data and some different things that can not be done using standard tools of JotForm.

  • jonathan
    Replied on June 25, 2019 at 8:17 AM

    But I couldn't find any solution to wait until form finishing loading and after that use our code. Is there any way to do it? It would be very useful functionality that can help many people to make complex applications conveniently based on JotForm. 

    Please check on JotForm API also here https://api.jotform.com/docs/#post-form-id-questions

    And Webhook also here How to Setup a Webhook with JotForm

    I can see that you are already adept with using the form source code and creating your own custom codes, so I think the API and Webhook can work for what you need.

    I hope this help. Let us know if you need further assistance.