Skip to main content
billyc35864548
Participant
March 25, 2016
Answered

Once a dropdown is set to readonly I need a button to be hidden, how can I do this?

  • March 25, 2016
  • 1 reply
  • 751 views

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;

}

This topic has been closed for replies.
Correct answer try67

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


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>

1 reply

try67
Community Expert
Community Expert
March 25, 2016

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?

try67
Community Expert
Community Expert
March 25, 2016

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

billyc35864548
Participant
March 25, 2016

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.