cryostar Posted September 19, 2021 Share Posted September 19, 2021 I used the LoginRegister module for my members' portal, and part of the registration form is a field called "Where did you hear about us?" which is an InputFieldCheckboxes field. I don't want to set this as required on the user template because that would also be required for staff users as well. So I set up a hook before "LoginRegister::renderRegisterForm" to set it to required. $form->getChildByName('register_referralmode')->attr('required','required'); It works for other fields that I set to required in this approach, but this field in particular is not applying that attribute. Any thoughts on what could be the issue here? Link to comment Share on other sites More sharing options...
alexm Posted September 19, 2021 Share Posted September 19, 2021 Not tested, but you could try: $f = $form->getChildByName('register_referralmode'); $f->required = 1; 1 Link to comment Share on other sites More sharing options...
cryostar Posted September 25, 2021 Author Share Posted September 25, 2021 @alexm Thank you! This one works perfectly. ☺️ 1 Link to comment Share on other sites More sharing options...
alexm Posted September 25, 2021 Share Posted September 25, 2021 @cryostar ?? Perfect! Glad to hear it ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now