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.
Can I change the value of a field "on submit"Asked by robinbruce on October 21, 2015 at 11:44 AM
I have a form to capture a user request with a hidden approval section at the foot.
I want the users to submit the form without sight of the approval section.
The admins will then access the form via the "edit submission" link and I do want those guys to see the hidden section.
The solution I had in mind for this was to have a hidden field somewhere in the form with some contents that would hide the approval section during the initial submission. I then wanted to clear the contents of that hidden field on submit of the form itself, my thinking being that the hidden section would now be shown by default via the edit link. Its at this point I've come unstuck - how can I change the value of that field as a side effect of the user hitting the submit button? can anyone help?
I have a workaround in mind. Please give me some time to present it in my next reply. I'll get back to you as soon as I'm able to make it work.
Unfortunately, it is not possible to prepopulate a hidden field in the edit link submission. However, if you are editing it in the submissions page in edit mode then the hidden field will be displayed.
Here's my sample edit link form: https://submit.jotformpro.com/form.php?formID=52935323021951&sid=321257645055443862&mode=edit. You can clone my form here: https://form.jotform.com/52935323021951. Here's a guide on how to clone my form: http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL
Here's how my form works:
1. First, we will change the passcore field as a form calculation widget, we will also set it to "unhidden"
2. In the Form Calculation widget setting, open the advance option and untick the "Read Only" and enable the "Wait for input..." option.
3. I will then add a page break after the submit button, I want to have the 2nd page to be the section where the admins can see fields they need to fill out.
4. I will then use form collapse field to group the fields that I want to show/hide. Here's a guide that you can refer: http://www.jotform.com/help/297-Show-or-Hide-multiple-fields-at-once-using-form-collapse-tool. In this case, we want to group the "Business Partner Section" and the "CTO / Delivery Manager Section".
5. This page doesn't show immediately the "Business" and "CTO" section, I will add a drop down field to be the triggers.
6. Here's the conditional logic that I have setup:
IF "passcode" IS Equal to "business" then SHOW the "Page Break"
IF "passcode" IS Equal to "cto" then SHOW the "Page Break"
In the 2nd page here's the condition that is setup:
IF "Admin section" IS Equal to "Business Partner Section" then SHOW "Business Partner Section collapse field"
IF "Admin section" IS Equal to "CTO" then SHOW "CTO form collapse field"
7. How do we clear the passcode then? We can then setup another conditional logic for this. First, I'll add a check box for the "Business" and "CTO" section as triggers.
8. Now in the conditional logic, if those check boxes are filled out, then we will change the value of the passcode to a "space" only (we can't actually set a blank value using conditions so we use "space" instead).
I hope that helps or at least gives you an idea on how to proceed. Do let us know if you need more assistance on this.
Thanks Charlie - I'll look at your solution and see how far I get with it... Cheers!
On behalf of my colleague Charlie, you are most welcome. After trying this method, please let us know about its final state.