I want to create a PDF that provides either content (text) or options contingent on the value chosen in a previous field.
For purposes of question one; here is a simple example
Assume a form with 2 fields; Size and Color.
For size, there are two options in a dropdown; "small" and "large"
If the user selects "small", then text options for color would be "red" and "green".
If the user selects "large", then text options for color would be "black" and "white".
Copy link to clipboard
1. Yes, this can be achieved using a script.
Here's the code for your example. It should be used as the custom validation script of the "Size" field:
var colorField = this.getField("Color");
if (event.value=="small") colorField.setItems(["red", "green"]);
else if (event.value=="large") colorField.setItems(["black", "white"]);
Thank you for the direction. That will definitely get me headed the right way.
Another question: The example I gave was a simplified version of what I really want to do (close enough though, that I can get it to work). However, with more complexity - would it be advisable to develop within Indesign and export to PDF?
No. In fact, I would recommend doing all the fields work in Acrobat, including scripts.