Skip to main content
Participant
October 3, 2023
Answered

Cannot input validation code

  • October 3, 2023
  • 1 reply
  • 1263 views

Hi,

I'm trying to populate a dropdown field using the result from a previous dropdown field. 
This is the code i found: 

if(event.value == "Item1")
this.getField("Dropdown2").setItems(["Item 1","Item 2","Item 3"]);
else if(event.value == "Item2")
this.getField("Dropdown2").setItems(["Item 4","Item 5","Item 6"]);
else this.getField("Dropdown2").clearItems();

However, when I try to input this code in the "Run custom validation script" box, the code simply disappears when i click OK after editing.. How can I solve this?

Thanks!

This topic has been closed for replies.
Correct answer BarlaeDC

Hi,

I was able to copy and paste the code into Acrobat in the location you specified and it worked as expected. Can you provide your version of ACrobat/and or check you are up to date?

 

 

1 reply

BarlaeDC
Community Expert
BarlaeDCCommunity ExpertCorrect answer
Community Expert
October 5, 2023

Hi,

I was able to copy and paste the code into Acrobat in the location you specified and it worked as expected. Can you provide your version of ACrobat/and or check you are up to date?

 

 

Participant
October 11, 2023

Hi,

I managed to solve it in the end with a different code. I think it somehow bugged out and considered any code fault. Working fine now, thanks!