Hidden Form field validation

I have a hidden form field that is required. I cannot get the error message to show up. Even if i trigger a validation it will not show. If I change from hidden to text it works fine. How can I get the error message to show when it is hidden?

input type=“hidden” name=“userid” id=“inp_userid” required="" data-msg-required=“Select User First”
div class="" id=“hidden_error” dmx-show=“inp_userid.invalid”
Select User First
/div

Community Page
Last updated: