Select dropdown option, show a textfield, empty textfield shows dropdown options again
Copy link to clipboard
Copied
Hi
I'm pretty new to Adobe Forms / Javascript so go easy on me!
I have a drop down called "Shipping Type" with 3 options - Pallets, Loose, Other.
On selection of Other I would like a textbox (called "ST-Other") to show where the Dropdown was with default text - Please Specify Requirments
If you backspace all text from the textbox I want the Dropdown options to show again.
Is this possible?
Along with the javascript, please let me know if i need to enable any Actions as well? On mouse focus? blur? etc?
Thankyou! 🙂
Copy link to clipboard
Copied
I would not recommend you do that. It can be quite confusing for the user. You should create the text field next to the drop-down and show/hide it as needed.
Copy link to clipboard
Copied
Use this as 'validation' script of dropdown field:
if(event.value == "Other"){
event.target.display = display.hidden;
this.getField("ST-Other").display = display.visible;
this.getField("ST-Other").value = "Please Specify Requirments";}
Use this as 'Validation' script of text field:
if(event.value == ""){
event.target.display = display.hidden;
this.getField("Shipping Type").display = display.visible;}

