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

Set Field as Required

Avatar

Level 4

I would like to make a field required based on the which radio button is selected. Example:

     Next available date

     Specific date

     If the user selects specific date then the following date field need to be required.

Thanks you any assistance.

Parre

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can write in the click event of the radiobutton: Java Script

if(RadioButton1.rawValue == "Value to Compare"){

      SpecificDate.mandatory = "error";

}

else{

     SpecificDate.mandatory = "disabled";

}

Thanks

Srini

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

You can write in the click event of the radiobutton: Java Script

if(RadioButton1.rawValue == "Value to Compare"){

      SpecificDate.mandatory = "error";

}

else{

     SpecificDate.mandatory = "disabled";

}

Thanks

Srini