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, Sean - Tracker, Chris - Tracker Supp, 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 » Mon Mar 09, 2020 5:43 pm

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: 3142
Joined: Wed Jan 03, 2018 6:52 pm

Re: Change properties of another field

Post by TrackerSupp-Daniel » Mon Mar 09, 2020 7:00 pm

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

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

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

Re: Change properties of another field

Post by Ocasio » Mon Mar 09, 2020 7:10 pm

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: 3142
Joined: Wed Jan 03, 2018 6:52 pm

Re: Change properties of another field  SOLVED

Post by TrackerSupp-Daniel » Mon Mar 09, 2020 7:34 pm

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.tracker-software.com/knowle ... -PDF-forms


Kind regards,
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

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

Re: Change properties of another field

Post by Ocasio » Mon Mar 09, 2020 8:05 pm

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: 3142
Joined: Wed Jan 03, 2018 6:52 pm

Re: Change properties of another field

Post by TrackerSupp-Daniel » Mon Mar 09, 2020 8:25 pm

Hi, Ocasio

Glad to see that you've found a solution!

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

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Post Reply