Copy link to clipboard
Copied
I am making a universal form for multiple scenarios and looking to have the user prompted to only fill out specific sections of the form based on which drop down item they choose. Is there a way to do this? Maybe they highlight after selecting the desired menu item? Thanks!
Copy link to clipboard
Copied
You can set fields as read-only based on the selection in the drop-down.
Here's a simple example, which you can use as the custom Validation script of the drop-down field:
// Set fields as read-only or as editable based on the selection
this.getField("Text1").readonly = (event.value=="Option 1");
this.getField("Text2").readonly = (event.value=="Option 1");
this.getField("Text3").readonly = (event.value=="Option 1");
this.getField("Text4").readonly = (event.value=="Option 2");
this.getField("Text5").readonly = (event.value=="Option 2");
this.getField("Text6").readonly = (event.value=="Option 3");
// Reset the disabled fields
if (event.value!="Option 1") this.resetForm(["Text1", "Text2", "Text3"]);
if (event.value!="Option 2") this.resetForm(["Text4", "Text5"]);
if (event.value!="Option 3") this.resetForm(["Text6"]);
Copy link to clipboard
Copied
You can also hide and show fields,
https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm
Copy link to clipboard
Copied
++ Adding to the discussion,
To prompt a user when an particular item is selected from a dropdown menu list, you can use a custom keystroke script to trigger an alert message when that particular item is selected form the list.
For example, I created a dropdown menu with three items, and I named them "item1", "item2", and "item3".
You can use a cutom keystroke script like shown below to show a message alert to the user when "item1" is selected:
if (event.willCommit) {
if (event.value == "test1")
app.alert("Please select Option 1 of block B in Page", 3);
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now