Copy link to clipboard
Copied
I am creating a form in which there is a list of activities that need to be completed by the user (or multiple users). Each activity will need to sign for. After the last activity, the user needs to sign that all activities have been completed before the form goes to the next department for completing their activities.
I'd like to restrict the signing of that last signature for each department until all the other activity completion signatures have been inserted.
I've tried the show/hid function - but that didn't seem to work...
I've exhausted my googling! LOL please help!
Copy link to clipboard
Copied
Showing/hiding the signature field should work. What have you tried, and what were the results?
Copy link to clipboard
Copied
At first I tried the show/hide in the Sign tab for each field...but I must have done something wrong because the field "showed" after the first activity was signed for
Then I found this code suggestion - placed in a separate text field (hidden) in the Calculate tab - adding in the steps to look at for this particular signing function. (THIS WORKED)... Guess I needed to google just one more time! LOL I am a 'newbie' when it comes to working with code - so the explanaition in the article I found wasn't as clear as I needed at first - but some test-and-try - and I finally got to my desired result.
I put some 'comments' in to help the next person that finds this...(please edit it if I didn't quite get the explanation correct)
I will do this to the other column of activities that the next department needs to do and I should be ready to go!
var bReady = true;
if(this.getField("ProdSignStep1").value.length == 0) bReady = false;
[comment: replace "ProdSignStep1..." with the field that you need to have filled in/completed before the last signing field displays. Do this with all fields that need to be filled in before the "last" field displays. Copy this line and change/add/remove as needed for your form data
"False" means nothing is in that field.]
else if(this.getField("ProdSignStep2").value.length == 0) bReady = false;
else if(this.getField("ProdSignStep3").value.length == 0) bReady = false;
else if(this.getField("ProdSignStep4").value.length == 0) bReady = false;
else if(this.getField("ProdSignStep6").value.length == 0) bReady = false;
else if(this.getField("ProdSignStep8").value.length == 0) bReady = false;
else if(this.getField("Text30").value.length == 0) bReady = false;
[comment: So basically all lines above this are checking to see if there is anything in those fields named in the line. It is checking each one each time.]
if(bReady) this.getField("ProdEndSign").display = display.visible;
[comment: replace "ProdEndSign" with the field that you need to have filled in after all other fields have been filled in]
else this.getField("ProdEndSign").display = display.hidden;
[comment: These two lines above instruct the form to either show or hide the field named here (ProdEndSign) depending on the results from the checks above)]
Copy link to clipboard
Copied
Using the Signed event of the Signature field can't work, as that is triggered once the field is signed, and you want to hide it before it is signed...
Copy link to clipboard
Copied
Thank you, Thank you, Thank you, Joy_NC!!!! I've been trying to figure this out for a couple weeks and tried one more time to google it and came across your post. THANK YOU for adding the comments. Extremely helpful. Beyond grateful for the breakdown. Kudos!