JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
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.
Collect POST data from a lightbox without refreshing page?Asked by LDMedia on February 12, 2012 at 09:21 PM
I am using a jotform to allow users to create new listings on my site, I have set up a page to collect the POST data and enter it into a database table using php.
I would like to make the process of creating a listing as seemless as possible, ideally returning to user to the same place they were when they opened the jotform.
Currently I am using a lightbox to minimise the number of refreshes necessary to submit a listing, but the lightbox form requires the whole page to refresh to a 'thank you page' destination to collect the POST data, from here I can set an auto refresh back to the homepage but not where the user started from.
1) Is there a way I can collect the url of the page that the user first opened the lightbox/jotform on so as to pass it along as a variable, and ultimately return the user to their starting location once the POST data is collected?
2) Is there a way to collect POST data / form submissions without using a thankyou page? So that the lightbox just closes on submission.
3) Any other ideas?
I'm not sure if this is possible since running a lightbox script is completely dependent on JotForm's server for it to load.
Although it is possible to redirect back the user to the previous page by adding a hidden field in your lightbox script and have it prepopulated with the value of the page or the URL or the page. By doing this, it will also submit the value of the URL. You can then get this in your thank-you page and then use it for redirection so that the viewer will then be sent back to the page where he was when he filled up your lightbox form.
You can check out our Seyhun's last post for the code instructions on how to prepopulate your lightbox code from this thread: http://www.jotform.com/answers/13568-How-to-pass-parameters-with-lightbox
Please let us know if you need further assistance.
Greetings!We are happy to announce that we have released Jotform Webhooks, this feature would replace Send Post Data + Custom URL Thank You Page workaround in order to help you transfer forms data to your own database using your own script codes.
To know more about Jotform Webhooks, please click here.
Thank you for using JotForm. :)