How to get POST data without using PHP, using only Javascript instead?

  • SixPlus
    Asked on March 2, 2016 at 5:11 PM

    If I use javascript on both client and server, and we have a custom redirect URL thank you page, how would I go about accessing that POST data on that page (since we dont use PHP)?

     

    Thanks!

  • Kevin Support Team Lead
    Replied on March 2, 2016 at 7:29 PM

    What embed method are you using? 

    I think this could only be possible using the source code of your form, this guide will help you to get it: http://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form

    Once you have embedded your form using the source code, you may use Javascript to get and pass the data through your form to your "Thank You" page, I found a link that I think would be helpful, take a look on this link: http://www.htmlgoodies.com/beyond/javascript/article.php/3471111

    Otherwise you will need to add at least some lines of PHP code to get the data and pass it using Javascript. 

    Hope this helps.

  • SixPlus
    Replied on March 18, 2016 at 3:36 PM

    I'm sorry but that makes little sense to me. I ended up modifying the source code, but JotForm injects so many global variables and interferes with single page applications in such a way that makes it very undesirable to use the source code solution. 

    I wanted to revisit this problem because I don't understand how PHP is necessary to receive the POST data if I go with the iframe solution. Why is there not a feature to set up an API endpoint for you hit with the information submitted to Jotform? We use Javascript on the backend (with nodejs) - so I can still receive data via our application's API and process it there. 

  • Kevin Support Team Lead
    Replied on March 18, 2016 at 4:36 PM

    Seems like you need to have PHP running on your server if you want to get the POST data, so you will need at least one PHP file where you will capture the submitted data and then pass it to Node.JS through Javascript. 

     

    What is the API that you are using? 

     

    Perhaps there is other way to achieve it, or we could request for an integration with the service that you are using so our developers might implement it.