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

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

    Asked by SixPlus on March 02, 2016 at 05: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!

    Page URL:
    https://sixplus.com/concierge

    POST post data thanks redirect URL
  • Profile Image
    JotForm Support

    Answered by Kevin_G on March 02, 2016 at 07: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.

  • Profile Image

    Answered by SixPlus on March 18, 2016 at 03: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. 

  • Profile Image
    JotForm Support

    Answered by Kevin_G on March 18, 2016 at 04: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.