Skip to main content
Participating Frequently
July 25, 2024
Question

Change output textfield based on input checkboxes

  • July 25, 2024
  • 1 reply
  • 703 views

Good afternoon,

I have a text field which should standard show the text “Permanent Architecture” if none of the checkboxes are checked. There are 4 checkboxes, 10 Y, 12 Y, 15 Y and 20 Y. These checkboxes are set up in a way that the user only can check one checkbox at a time. So based on which checkbox is checked (or if none is checked), the text in my text field should change like the following:

 

10 Y – If this checkbox is checked the text should change to “Permanent Architecture 10 Years”

12 Y - If this checkbox is checked the text should change to “Permanent Architecture 12 Years”

15 Y - If this checkbox is checked the text should change to “Permanent Architecture 15 Years”

20 Y - If this checkbox is checked the text should change to “Permanent Architecture 20 Years”

 

I assume this probably should be coded in Javascript. But since I don’t have any experience with Javascript, I hope that someone is willing to help me with this?

Thank you in advance.

This topic has been closed for replies.

1 reply

PDF Automation Station
Community Expert
Community Expert
July 25, 2024

Enter the following as a custom calculation script in the text field:

event.value="Permanent Architecture";
if(this.getField("10 Y").value!="Off")
{event.value="Permanent Architecture 10 Years"}
if(this.getField("12 Y").value!="Off")
{event.value="Permanent Architecture 12 Years"}
if(this.getField("15 Y").value!="Off")
{event.value="Permanent Architecture 15 Years"}
if(this.getField("20 Y").value!="Off")
{event.value="Permanent Architecture 20 Years"}
Participating Frequently
July 25, 2024

Thank you for your help. I have entered this code but it seems not to be working exaclty as it should. Because no matter which check box I check, the textfield always shows the same result: "Permanent Architecture 10 Years". It seems as if the other If-statement are not taken into account.

PDF Automation Station
Community Expert
Community Expert
July 25, 2024

Are 10 Y, 15 Y, etc. the names of the checkboxes or the export values?