Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

If statement for drop down

Avatar

Level 1
When a user selects "Indiana" from my dropdown box, an informational text box (Indiana Former Employer Information) needs to change from optional to required.



I'm not familiar with scripting and don't know how to write this. I have part of it, but cannot figure out how to make the text field required. Suggestions?



Thanks,

--cat
1 Reply

Avatar

Level 4
In the change event put this (changed to suit your fields):



if (xfa.event.newText == "Indiana")

{

Form.Field.mandatory = "error";

}

else

{

Form.Field.mandatory = "disabled";

}



Hope this helps,



Tom