Page 1 of 1

Change properties of another field

Posted: Mon Mar 09, 2020 5:43 pm
by Ocasio
I have a form that, if one checkmark is "TRUE" then many other field should not be filled

What I want is that, if the user checkmarks that field, 5 other fields should be set to "read-only" with a specific text N/A and another checkmark field should be "TRUE"

Also if the checkmark is removed, or "FALSE" then that read-only status should be eliminated.

Any javascript to do this? Thanks in advance.

Re: Change properties of another field

Posted: Mon Mar 09, 2020 7:00 pm
by TrackerSupp-Daniel
Hi, Ocasio

This should be possible using JavaScript, however I am afraid that I cannot assist in the initial creation of the script itself. Please see the Adobe JS API reference here for assistance with which methods to use for your inquiry:
https://www.adobe.com/content/dam/acom/ ... erence.pdf
(Readonly seems to be detailed on both pages 68 and 437)

Kind regards,

Re: Change properties of another field

Posted: Mon Mar 09, 2020 7:10 pm
by Ocasio
Thank you, im trying but I dont see how to make it work with a checkmark value. Is it mouse up? Down?

Re: Change properties of another field  SOLVED

Posted: Mon Mar 09, 2020 7:34 pm
by TrackerSupp-Daniel
Hi, Ocasio

Mouseup/down is when to run that, they are effectively the same except one is applied immediately upon depressing the mouse button while over the field, the other is applied only when releasing the mousebutton. Mouseup is used most often as it allows the user the depress the mouse and then realize before releasing it that they did not want to make the change, and move the mouse away from the field before releasing.

You would generally be applying the JS to the other fields however, not the checkboxes themselves, and having them check the "true/false" value of the checkbox in question. If the box is checked (true) then apply "readonly" to the current field, if the checkbox is not checked, remove that property. In this case, you would want to use the "value calculation" field, as a "custom action". Please see this article for details on creation fillable forms: https://www.pdf-xchange.com/knowle ... -PDF-forms


Kind regards,

Re: Change properties of another field

Posted: Mon Mar 09, 2020 8:05 pm
by Ocasio
I just did this and worked with mouse up as suggested

My intention was to clear and disable many other fields if a specific field is checkmarked

Code: Select all

var D = this.getField("Main_Checkmar");
var NA = this.getField("Text_Field").value;
var DMC = this.getField("Secondary_Checkmark");
{
if (NA == "Off"){
  D.value = "Write here";
  D.readonly = false;
  }
  else if (NA == "Yes"){
    D.value = "N/A";
    D.readonly = true;
    DMC.readonly = true;
    DMC.value = "Off"
  }
}

Re: Change properties of another field

Posted: Mon Mar 09, 2020 8:25 pm
by TrackerSupp-Daniel
Hi, Ocasio

Glad to see that you've found a solution!

Have a great day :D