I am displaying inputs on the front-end of my form that are populating a matrix within the CP.

Overall everything is working fine. The problem I am having is validation. I've got the field marked as required, but it seems leaving the fields empty still passes validation.


    <input type="hidden" name="fields[myMatrix][new1][type]" value="myField">
    <input type="hidden" name="fields[myMatrix][new1][enabled]" value="1">


    {{ account is defined and account ? errorList(account.getErrors('myMatrix')) }}

Whenever I comment these fields out, I get the validation message that the field is required. I believe it has something to do with those hidden input(s) a value. But, if I take those out, the fields do not populate the input in the CP.

How can I show the fields on the front-end and still show the error message?


Your Answer

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

Browse other questions tagged or ask your own question.