Copy link to clipboard
Copied
I have tried everything and can't get it to work. Here is one that I tried:
var HourField = this.getfield("Hours");
if (HourField.readonly == true){
this.getfield("Submit Button").display = display.hidden;
}else{
this.getfield("Submit Button").display = display.noPrint;
}
But it probably doesn't trigger the calculation script... Why not simply
add it to the Signed event of the signature field?
On Fri, Mar 25, 2016 at 5:01 PM, billyc35864548 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
This code looks fine... Where exactly did you place it, though?
Also, do you see any error messages in the JS console when you run it?
Copy link to clipboard
Copied
Correction, I've spotted an error. The name of the function is "getField", not "getfield".
If you check the JS console then you should see an error message that says something like getfield is not a known function...
Copy link to clipboard
Copied
Thank you for the quick response! I had placed it in the custom calculation script, under the Calculate tab. I will try your correction and get back with you.
Copy link to clipboard
Copied
It doesn't work when I set the field to read only by signing the document. (The signature sets the Hours dropdown menu to "readonly" and is supposed to make the submit button hidden).
Copy link to clipboard
Copied
But it probably doesn't trigger the calculation script... Why not simply
add it to the Signed event of the signature field?
On Fri, Mar 25, 2016 at 5:01 PM, billyc35864548 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Thank you for the answer, I just added this to my signed script as you suggested:
//Sets everything as read only
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
f.readonly = true;
}
//Sets my Submit Button as hidden
this.getField("SubmitButton").display = display.hidden;
// Make a few fields read/write again after the "Nuke all" code above made everything readonly
this.getField("TrainingReportUpdated").readonly = false;
this.getField("PCard").readonly = false;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now