I want to require that a checkbox be checked on a Community form. I am able to display an alert when it isn't checked. I don't want to do that. I want to display text on the form. I think I should be able to do this by dynamically adding CSS. I don't know how to do that. Pointers?

    var legalChecked = component.find("legalnotice").get("v.value");
    if(!legalChecked) {

I am able to use $A.util.addClass(legalNotice, 'hasborder') and `$A.util.removeClass(legalNotice, 'hasborder') to accomplish the dynamic application of CSS

  • 1
    Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
    – Derek F
    Feb 17 '20 at 20:15
  • Using addClass is the answer that I found to my problem. Feb 18 '20 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.