Copy link to clipboard
Copied
I am currently trying to create a form within PDF it will allow the user to select from the drop-down menu and based on the selection will auto populate a text field with a statement. I would also like the user to be able to edit the statement‘ Once it has been auto-populated.
My drop-down menu “Shipdec2”
My text field “statdec1”
I would be grateful if you can assist.
I am a beginner in adobe
You can use something like this code as the custom validation script of the drop-down field:
if (event.value == "Option 1") this.getField("statdec1").value = "Text for option 1";
else if (event.value == "Option 2") this.getField("statdec1").value = "Text for option 2";
else if (event.value == "Option 3") this.getField("statdec1").value = "Text for option 3";
etc.
Just make sure you tick the option to commit the selected value immediately (under the drop-down's Properties, Options tab), so the text field will update as soon as you make a selection.
Copy link to clipboard
Copied
I am currently trying to create a form within PDF it will allow the user to select from the drop-down menu and based on the selection will auto populate a text field with a statement. I would also like the user to be able to edit the statement‘ Once it has been auto-populated.
My drop-down menu “Shipdec2”
My text field “statdec1”
I would be grateful if you can assist.
I am a beginner in adobe
You can use something like this code as the custom validation script of the drop-down field:
if (event.value == "Option 1") this.getField("statdec1").value = "Text for option 1";
else if (event.value == "Option 2") this.getField("statdec1").value = "Text for option 2";
else if (event.value == "Option 3") this.getField("statdec1").value = "Text for option 3";
etc.
Just make sure you tick the option to commit the selected value immediately (under the drop-down's Properties, Options tab), so the text field will update as soon as you make a selection.
Copy link to clipboard
Copied
You can use something like this code as the custom validation script of the drop-down field:
if (event.value == "Option 1") this.getField("statdec1").value = "Text for option 1";
else if (event.value == "Option 2") this.getField("statdec1").value = "Text for option 2";
else if (event.value == "Option 3") this.getField("statdec1").value = "Text for option 3";
etc.
Just make sure you tick the option to commit the selected value immediately (under the drop-down's Properties, Options tab), so the text field will update as soon as you make a selection.
Copy link to clipboard
Copied
Is there anything I need to put into the text box field ”statdec1”?
Also, will this allow the user to edit the statement that has been auto populated into “statdec1”?
Appreciate your time! I’m most grateful!
Copy link to clipboard
Copied
- No.
- Yes.
Copy link to clipboard
Copied
Is there anything I need to add to the end of the script, like a bracket?
appreciate your assistance!
Copy link to clipboard
Copied
This worked beautifully. Thank you!