And I need to insert a “require” validation, one of the options needs to be chosen.
When I select one of the options and set “Required” the message appears inside of the radio group!
Just had a similar case today and saw the same thing.
In my code I have required on all radio inputs. I don’t have a radio group.
But it always shows the message in the last input. And break the UI as well, because of the dmx validator message div. Just need some class fix for radio/checkbox components.
I did some testing with the validator and for me with bootstrap 4 it looks like:
It almost looks like it didn’t detect bootstrap in your case, do you use local, cdn or custom version of bootstrap and how does the css include look like?
Since it is not a default location it is not being detected. We check the urls of the stylesheets to detect which bootstrap is included to know where error messages should be inserted and which classes should be added since these differ per framework. When the validator can’t detect a framework it will place the error message directly after the form element (input), in your case directly after the checkbox and before the label element.
@patrick is this just for BS4?
We tested this on BS5 and it just moves the required message from last radio to first one. It still disrupts the UI. What would be ideal is that the message shows up at the bottom of all the radios, irrespective of their alignment.
The update should have a better Bootstrap detection, instead of searching the specific css include it checks for the bootstrap javascript object and extracts the version from it. It should not change anything when bootstrap was already detected correctly.
How was the BS5 included on the page, do you also have the javascript include on the page and where is it located?