Can I prepopulate a field in edit mode?

  • jfleischauer
    Asked on January 29, 2015 at 12:23 AM

    I'm working on an approval form, and I'd like to be able to control access to the approval part of the form based on the value of a hidden radio button field, with options for "Is Approver" or "Is Not Approver". I'd like to allow users to edit their submissions, so my thought is to pass the value of that field via URL parameters, and put those links in the various emails (i.e. have an edit link for the user that passes "Is Not Approver" and one for the approver that passes "Is Approver"). The value of that field would then hide or show the approver fields fields as appropriate.

    My issue is that I can't figure out how to pass a URL parameter when editing a submission, only when creating a new submission. Is this even possible?

  • Ashwin JotForm Support
    Replied on January 29, 2015 at 8:29 AM

    Hello jfleischauer,

    Unfortunately it is not possible to pass URL parameters with edit link. Even if you construct your own edit link and add pass URL parameters, the data will not be populated in your form fields. 

    There is one another way to achieve your requirement. You should password protect your form section which is for "Approver" user. You may like to take a look at the following thread where I have explained this in detail:  http://www.jotform.com/answers/401633 

    Hope this answers your query.

    Do get back to us if you have any questions.

    Thank you!

  • jfleischauer
    Replied on January 29, 2015 at 12:23 PM

    I've looked at that solution, and the problem I'm running into is I want to allow the user to be able to edit the form after they submit it. With that solution, though, the access key is saved with the rest of the form, leaving the Approver section available for the user if they edit it after it has been reviewed. Is there any workaround for that?

  • Ashwin JotForm Support
    Replied on January 29, 2015 at 1:48 PM

    Hello jfleischauer,

    I can understand that problem but I am unable to think any workaround to solve this issue. The input data of form fields will always be captured. 

    We can try some workaround with "Hidden Box" widget or hidden text box but before that we need to find out who will be the approver. Are you or admin who has access to your form's submission page will approve the user submission?

    Do get back to us on this and if possible we will try to figure out the workaround.

    We will wait for your response.

    Thank you!

  • jfleischauer
    Replied on January 29, 2015 at 2:24 PM

    To answer your question, we have several people who may be approvers, but not all have access to the submission page.

    One thought that I had was whether it might be possible to clear that field on save, maybe using a script. Any thoughts on that?

  • Ben
    Replied on January 29, 2015 at 3:29 PM

    Yes, that would be possible. I have altered my sample created here: http://www.jotform.com/answers/500138 to match this.

    You can see the jotform with this here: http://form.jotformpro.com/form/50286472718966

    ContractID (password field) is staff123

    Do let us know if that is something that you are after.

  • jfleischauer
    Replied on January 29, 2015 at 4:05 PM

    That did exactly what I need. Thanks!

  • Ben
    Replied on January 29, 2015 at 5:13 PM

    That is great to hear :)

    Do let us know if you have any further questions and we would be happy to assist.