Fixed Radio custom field do not set required attribute correctly

TickTackk

Well-known member
Affected version
2.1.10 Patch 2
It instead sets required on the ul.inputChoices instead of input[type="radio"]

HTML:
<ul class="listColumns inputChoices" required="required">
                <li class="inputChoices-choice"><label class="iconic  iconic--radio"><input type="radio" name="custom_fields[...
 
This is not entirely unexpected as I suspect there's no explicit handling of the required attribute and unhandled attributes likely go, by design, on to the surrounding list rather than the list items.

Worth noting the same happens with checkboxes too but that would be a less prevalent issue.

Currently the way to get the desired behaviour with both radios and checkboxes is that you apply the required attribute to the <xf:option /> tags instead as required.

Which is actually analogous to actual HTML where the <xf:option> tags represent the inputs themselves. And with radios you only actually need to set a single one of the inputs required to make the entire set of radios required.

So not convinced we'd be making changes here, though we'll keep this open for a bit.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 Beta 3).

Change log:
Appropriately allow radio custom fields to be marked as required.
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom