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.
Is it possible to update the value of a field in existing submission through PHP code?Asked by rrgrou on March 14, 2016 at 02:07 PM
I made a hidden field in my form.
The name of that field is : PAYED and the default value of that field will be NO
After completing the form i go to my payment provider by pushing the SEND button.
At that moment the submission is saved and i am leaving the form.
There i use a php script to make the payment.
After the payment is done i like to update the hidden field PAYED with the value YES
That can also be done in the php script.
Is it possible to update one field (in my case the PAYED field) by sending it to a URL adres
like you do in Prepopulating-fields-to-your-JotForm-via-URL-parameters
XXXXXXXX will be the attribute of the specific submission.
It would not be possible to do the same over URL pre-population, since that would make a new submission, but for that to be possible it would require your PHP script to activate the submission as well.
This would however be possible by using the API.
You can see more about it on the following link: http://api.jotform.com/docs/#post-submission-id
On the top left you would be able to select "PHP" as the script of the choice (or some other if you prefer).
Thanks for your answer, but how can i read the submisson ID number in my PHP script
like i use for fieldname <?php $var1=$_POST["fieldname"] ?>
You are welcome. Submission ID should be seen as "ID".
What I do recommend is to check the form fields that you get sent to your PHP script by looking at the request bin.
You can see it here: RequestBin — Collect, inspect and debug HTTP requests and webhooks
This is done by sending a test request after setting up the webhook: How to Setup Webhook with JotForm
That will help you quickly get all of the fields from your form in the data that it is sent allowing much easier codding of your own scripts.