Skip to main content
Participant
March 15, 2021
Question

How do I relate the value of a field to act on another form field

  • March 15, 2021
  • 2 replies
  • 401 views

I am making a form in which I need to have some fields blocked and that according to the responses that are generated they are automatically unlocked, for example: when asked if they have a child, yes or no is checked, if the answer is YES, they are activated the child name fields, if the answer is NO, are kept blocked.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
March 15, 2021

It's possible, but what kind of fields are they?

Showing/hiding the other fields is not enough. You also need to reset them when they are hidden, or you will end up with invalid data filled into the form, which can cause issues if you export it, for example.

Thom Parker
Community Expert
Community Expert
March 15, 2021

There are a couple of options for this. The ReadOnly property will lock the fields, although they still look the same, or they can be hidden/shown.

Here's a tutorial on hiding/showing fields.  The same scripts can be used to set the readonly field property if you want to go that route.

https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm?sd=40

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often