A bit late, but I found this post because I have the same issue (in Joomla 5, but it's probably not so different).
I have no solution yet, but look at the HTML source code and the JS console in your browser.
If the form field has a "required" attribute like this example (at the end of the line), the browser's standard validation is triggered:This does not work on fields that are not displayed. The fancy select shows a custom interface (some own DOM structure made of DIV's) and hides the actual form field, so that's why you should be seeing an error in the console looking like that (where myfield is just an example and would be the name of your field):
An invalid form control with name='jform[myfield]' is not focusable.
So to solve this, I guess the "required" attribute needs to go from the form field, but working with XML forms, I don't exacly know yet how this should be done. I don't want to cry "bug", maybe there's a solution we just don't know. I am using component-creator.com for my component which is generating the forms XML that way. But it seems others have the same issue.
I have no solution yet, but look at the HTML source code and the JS console in your browser.
If the form field has a "required" attribute like this example (at the end of the line), the browser's standard validation is triggered:
Code:
<joomla-field-fancy-select class="required" placeholder="My Field" required>
An invalid form control with name='jform[myfield]' is not focusable.
So to solve this, I guess the "required" attribute needs to go from the form field, but working with XML forms, I don't exacly know yet how this should be done. I don't want to cry "bug", maybe there's a solution we just don't know. I am using component-creator.com for my component which is generating the forms XML that way. But it seems others have the same issue.
Statistics: Posted by citystrolch — Fri May 17, 2024 5:01 pm