Copy link to clipboard
Copied
Hello There...
I have a document that I added checkboxes to the team can select to add text to another field. This is the javascript I used on the field the text is populating in:
if(this.getField("RP").valueAsString != "Off")
event.value = "SEE SERVICE WORK ORDER FOR JUSTIFICATION - Service and Repair To:";
else if(this.getField("M").valueAsString != "Off")
event.value = "[AGE] Year Old [SEX] with a history of [DX] requiring Modification to [EQUIPMENT] for mobility.";
else if(this.getField("NRB").valueAsString != "Off")
event.value = "[AGE] Year Old [SEX] with a history of [DX] requiring [EQUIPMENT] for mobility.";
else
event.value = "";
The problem is I need the team to be able to double click on the words with brackets around them to highlight and change them. With this script, as soon as they change the words, the script reverts they sentence back. Any ideas to make this work?
Copy link to clipboard
Copied
I created Radio Buttons instead of checkboxes and added the following script:
if (event.target.value=="Choice1") this.getField("Justification").value = "SEE SERVICE WORK ORDER FOR JUSTIFICATION - Service and Repair To:";
Copy link to clipboard
Copied
You have a couple of options, remove 'else' part from your script, it will allow users to enter custom text.
Or use scripts in each checkbox.
Copy link to clipboard
Copied
You should really create separate entry fields for 'AGE', 'SEX', 'DX' and 'EQUIPMENT', and use those values in your calculation.
Copy link to clipboard
Copied
I created Radio Buttons instead of checkboxes and added the following script:
if (event.target.value=="Choice1") this.getField("Justification").value = "SEE SERVICE WORK ORDER FOR JUSTIFICATION - Service and Repair To:";

