We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
Hi there everyone,
I'm trying to make it so when the user selcts P or F from the droplist on the right that the date of inspection will be displayed on the left, but IF they select N/A I want the date not visible. Can anyone help me figure this out? Thank you in advance for all your help.
As the custom calculation script of the date field enter something like this:
event.target.display = (this.getField("Dropdown1").valueAsString=="N/A") ? display.hidden : display.visible;
Replace "Dropdown1" with the actual field name, of course.
Thank you so much! I just did it and it seems on the right track. When I choose N/A now the date disapperas, which is perfect, however if I then change the option back to the P or F, the date stays hidden and it does not reappear. Is there any way to fix that?
Thank you again for your exertse 🙂
It should happen automatically. Make sure to set the option to commit the selected value immediately, under the Properties of the drop-down field, in the Options tab.
Done and done sir :). Still no change though, it will only disappear not reappear.
The values are not what you said. There are space before them. You have to use EXACTLY the same value in the code as you did in this dialog.
You uses spaces before P and F.
You were totally right, I added the spaces into the script and now it works like a charm. Thank you to both of you for helpong me with this.
Thank you again,
If I wanted the script to also hide the date if the user selected F OR N/A, how could I do that?
Change this part of the code:
(this.getField("Dropdown1").valueAsString=="N/A" || this.getField("Dropdown1").valueAsString=="F")
Don't forget to add the spaces, though...
Wow, worked like a charm! Thank you again 🙂