Copy link to clipboard
Copied
I have a 2 page sales contract that needs to be made read only before being sent to a customer BUT there are a handful of fields that the customer might need to update, so these need to stay open.
I've seen various answers on here but can't find exactly what I need. I have a code in use on another document, but that makes the whole doc read only and you can't reverse it the action once the button has been pushed.
For info, I can't change the field names on my document as they are actually merge fields, but the fields I want to stay open I can add a prefix, so is there a code that will make all fields read only apart from the ones with a prefix of OPEN?
I've also seen on here that you can add a password to this action so if the salesperson hits the 'make read only' button early, he can reverse it by inputting a simple '1234' for example. He also has to input this to make the doc read only in the first place.
Thank you!
I assume that by prefixing you have determine how to group the fields that you want to hide and/or keep visible after the user selects YES or NO.
This means naming each group with a prefix following the example in this thread:
https://community.adobe.com/t5/Acrobat/editing-show-hide-field-list-via-javascript/td-p/3819705
Then adding a separate javascript action to your button or incorporating it in your current working script by adding these lines:
getField("OPEN").display = display.visible;
getFi
Hi,
Have you prefixed all your signature fields and your three checkboxes like shown in this link: https://community.adobe.com/t5/Acrobat/editing-show-hide-field-list-via-javascript/td-p/3819705
Also , I noticed that in this line of your script : if (f.type!= "signature") //
The "//" are commenting the next line of code, you should remove the forward slashes.
And my other question, are the signature fields requiring digital certificate or just a regular signature field where the user will be usi
...Yes, I grouped the fields and used the below with the digital signature.
This script executes when field is signed.
this.getField("Group1").readonly = true;
{
}
this.mailDoc({cTo:"john.smith@xxx", cSubject: "Request", cMsg: "Please send signed document "});
Copy link to clipboard
Copied
You may also consider adding a digital signature field for the customer.
In the properties for that field you can add actions through a java script OR you can assign an action to the aignature field to make read-only just the fields that you need to become read only or the entire document
Copy link to clipboard
Copied
Is_rbls,
I am using the below code to turn everything to read only but the second signature. When the first signature is complete .I have three check boxes that I need to leave unlocked. If I am reading the code correctly??? the signature field is staying available based on the field type, if (f.type!= "signature"). If so, can I just use the same for check box? if (f.type!= "check box"). If Yes where should it go? I tried it and it didn't work, what should I use?
Thanks for the help
for (var i = 0 ; i < this.numFields ; i++) {
var f = this.getField(this.getNthFieldName(i)) ;
if (f.type!= "signature") //
{
f.readonly = true ;
}
}
this.mailDoc({cTo:"", cSubject: "CAB QUAD Request", cMsg: "Please review and electronically Sign Document"});
Copy link to clipboard
Copied
Hi,
Have you prefixed all your signature fields and your three checkboxes like shown in this link: https://community.adobe.com/t5/Acrobat/editing-show-hide-field-list-via-javascript/td-p/3819705
Also , I noticed that in this line of your script : if (f.type!= "signature") //
The "//" are commenting the next line of code, you should remove the forward slashes.
And my other question, are the signature fields requiring digital certificate or just a regular signature field where the user will be using the Sign Tool to type in a name or to just draw an ink signature?
Copy link to clipboard
Copied
Thank you! The link was very helpful.
To answer the signature question, it is didgital signature.
Copy link to clipboard
Copied
you're welcome. I'm glad it helped.
Were you able to work around the script successfully?
Copy link to clipboard
Copied
Yes, I grouped the fields and used the below with the digital signature.
This script executes when field is signed.
this.getField("Group1").readonly = true;
{
}
this.mailDoc({cTo:"john.smith@xxx", cSubject: "Request", cMsg: "Please send signed document "});
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks, but this doesn't really do what I want.
The contract is open and the salesperson fills it in (with the customer via the phone). When he's finished, he needs to click a button that makes the specific fields read only (prices, term etc). Salesperson then sends it to the customer and they fill in the open fields (the direct debit mandate for example). I cannot add a signature field as we need a wet signature.
I'm after a JS to make the above happen on the click of the button. 🙂
Copy link to clipboard
Copied
I've done some digging elsewhere and I've cobbled together the following - it doesn't look pretty but it works for what I want ...
var r = app.alert("Are you ready to make this document read only?",2,2);
if (r == 4) { // 4 is Yes, 3 is No
for (var i = 0; i < this.numFields; i++) {
var fname = this.getNthFieldName(i);
this.getField(fname).readonly = true; // makes all fields readonly
// Sett all of the OPEN fields to NOT read-only
getField("OPEN").readonly = false;
}
}
..BUT, I also need hide some other fields when the document is made read only. No problem adding these as separate actions, but the fields get hidden even if the user clicks 'no' to the above question (are you ready to make this documenet read only?). How can I make it so these other fields only get hidden if the user clicks 'yes'? These other fields are all prefixed with HIDE
Copy link to clipboard
Copied
I assume that by prefixing you have determine how to group the fields that you want to hide and/or keep visible after the user selects YES or NO.
This means naming each group with a prefix following the example in this thread:
https://community.adobe.com/t5/Acrobat/editing-show-hide-field-list-via-javascript/td-p/3819705
Then adding a separate javascript action to your button or incorporating it in your current working script by adding these lines:
getField("OPEN").display = display.visible;
getField("HIDE2").display = display.hidden;
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied