Change properties of another field  SOLVED

A picture is worth a thousand words. We have created some pdfs tutorials showing common tasks.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
Ocasio
User
Posts: 10
Joined: Thu Oct 17, 2019 3:06 pm

Change properties of another field

Post 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.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Change properties of another field

Post 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,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Ocasio
User
Posts: 10
Joined: Thu Oct 17, 2019 3:06 pm

Re: Change properties of another field

Post by Ocasio »

Thank you, im trying but I dont see how to make it work with a checkmark value. Is it mouse up? Down?
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Change properties of another field  SOLVED

Post 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,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Ocasio
User
Posts: 10
Joined: Thu Oct 17, 2019 3:06 pm

Re: Change properties of another field

Post 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"
  }
}
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Change properties of another field

Post by TrackerSupp-Daniel »

Hi, Ocasio

Glad to see that you've found a solution!

Have a great day :D
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply