Copy link to clipboard
Copied
Hi everyone,
In PDF Forms I am struggling with adding some checkboxes and I've included an example.
I want people to only choose the option 'Yes' or 'No', so I gave the checkbox the same name with a different export value, but I want the checkbox 'Name' and 'Adress' only to be clickable when the checkbox for 'Yes' is checked, so that you cannot check the box for 'No' and check the box 'Adress' at the same time.
Thanks!
There are a couple of things that would create this effect.
1. Add a script to the MouseUp of the Yes and No buttons that will set the readonly propertly of the address box.
2. Add a "Show/Hide a field" action to the MouseUp of the Yes and No buttons.
The second option will work on more platforms because it doesn't use a script. #1 will only on PDF viewers that support scripting. But neither will work in all cases.
Hi,
I would recommend you change the Yes/No checkboxes to be a radio button group, as in this group only one field can have a value, so either the yes or no can only be clicked, if one is clicked it clears the value from the other one.
You can add a JavaScript on each of the radio buttons that shows/hides the other checkboxes, making so that they cannot be filled in if you radio buttons are not clicked correctly.
```
this.getField("Check Box2").display = display.visible;
this.getField("Chec
Copy link to clipboard
Copied
There are a couple of things that would create this effect.
1. Add a script to the MouseUp of the Yes and No buttons that will set the readonly propertly of the address box.
2. Add a "Show/Hide a field" action to the MouseUp of the Yes and No buttons.
The second option will work on more platforms because it doesn't use a script. #1 will only on PDF viewers that support scripting. But neither will work in all cases.
Copy link to clipboard
Copied
Hi,
I would recommend you change the Yes/No checkboxes to be a radio button group, as in this group only one field can have a value, so either the yes or no can only be clicked, if one is clicked it clears the value from the other one.
You can add a JavaScript on each of the radio buttons that shows/hides the other checkboxes, making so that they cannot be filled in if you radio buttons are not clicked correctly.
```
this.getField("Check Box2").display = display.visible;
this.getField("Check Box3").display = display.visible;
```
for when you want to be able to click the checkboxes and
```
this.getField("Check Box2").display = display.hidden;
this.getField("Check Box3").display = display.hidden;
```
Obviously you need to change the names of the fields.
Hope this helps