1

I have created a custom form in magento 2. I have placed a checkbox group having different company names as checkbox values like cmpy1, cmpy2, cmpy3 etc. I have also added an input field inside that group for which If somebody didn't belong to the specified company than he/she can enter their own company name. Now I want to give a required validation to this group and I want to use magento 2's default validation if possible.

asked Jan 6, 2017 at 10:31

1 Answer 1

0

add the required class in the checkbox input like

<input class="required" type="checkbox" name="product[category_ids][]" value='<?php echo $cat_model['entity_id'] ?>' />
answered Jan 6, 2017 at 11:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.