Can I change the value of a field "on submit"

  • robinbruce
    Asked on October 21, 2015 at 11:44 AM

    Hello

    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?

     

    Cheers

     

  • Charlie
    Replied on October 21, 2015 at 1:24 PM

    Hi,

    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.

    Thank you.

  • Charlie
    Replied on October 21, 2015 at 2:04 PM

    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"

    14454494782015 10 22 01 22 06 Screenshot 10

    2. In the Form Calculation widget setting, open the advance option and untick the "Read Only" and enable the "Wait for input..." option.

    14454494962015 10 22 01 22 46 Screenshot 21

    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.

    14454495152015 10 22 01 24 30 Screenshot 32

    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. 

    14454496112015 10 22 01 43 34 Screenshot 43

     

    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"

    14454503042015 10 22 01 57 40 Screenshot 54

     

    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.

    14454504302015 10 22 01 55 46 Screenshot 65

     

    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).

    14454504862015 10 22 01 55 14 Screenshot 76

     

     

    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.

  • robinbruce
    Replied on October 22, 2015 at 5:50 AM

    Thanks Charlie - I'll look at your solution and see how far I get with it... Cheers!

  • mert JotForm UI Developer
    Replied on October 22, 2015 at 8:36 AM

    Hi there,

    On behalf of my colleague Charlie, you are most welcome. After trying this method, please let us know about its final state.

     

    Thanks.