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.

Possible to validate for a specific field only if a checkbox is selected?

Avatar

Former Community Member
Is it possible to have a form validate (upon clicking the submit by email button) for population of a textfield if a checkbox has been selected? For example, if a user has selected the checkbox of Other this requires the Notes field to be populated. Can I set up a validation to check the Other field and if it's checked make sure that the Notes field isn't Null?



Thanks for any help.
2 Replies

Avatar

Former Community Member
Thanks for the thread link.



I got it. I put in this code:

if (xfa.resolveNode("form1.subForm.fieldName") == 1)

this.mandatory = "error";

}



And now it will validate for a null value prior to submitting via email.