Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Switch a TextField between Input Optional and Required

Avatar

Level 2

I would like to know how to switch a TextField between "User Entered - Optional" and "User Entered - Required" based on the value of another field on the form.  I know that I would set it to the proper value based on the default form that is initially displayed to the user, and put some script in the Change Event of that other field.  I just don't know what attribute and value of the TextField to change in my script.  Thanks for the help.

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hello,

Place the below script which ever event required to ur requirement.

this.validate.nullTest = "error";
this.validate.nullTest = "disabled";

check the attache pdf for sample.

Hope it will work with ur requirement.

Thanks,

Raghu.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 6

Hello,

Place the below script which ever event required to ur requirement.

this.validate.nullTest = "error";
this.validate.nullTest = "disabled";

check the attache pdf for sample.

Hope it will work with ur requirement.

Thanks,

Raghu.