You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually InputfieldSelect wrongly adds a blank option when field is not required and a default value is selected, I don't need and want it but can't disable it.
But when the field is required, it doesn't add the empty option when W3C says it should be, regardless of whether an option is selected (see below).
Actual code in InputfieldSelect:
if($allowBlank && !$hasBlankOption && !$this->attr('multiple')) {
if($this->getSetting('required') && $this->attr('value')) {
// if required and a value is already selected, do not add a blank option
} else {
$out .= "<option value=''> </option>";
}
}
Error: The first child option element of a select element with a required attribute, and without a multiple attribute, and without a size attribute whose value is greater than 1, must have either an empty value attribute, or must have no text content. Consider either adding a placeholder option label, or adding a size attribute with a value equal to the number of option elements.
The text was updated successfully, but these errors were encountered:
Actually InputfieldSelect wrongly adds a blank option when field is not required and a default value is selected, I don't need and want it but can't disable it.
But when the field is required, it doesn't add the empty option when W3C says it should be, regardless of whether an option is selected (see below).
Actual code in InputfieldSelect:
Proposed fix:
It always add empty option if no default option is selected, or if select is required.
W3C validation with a selected option and a required field:
W3C validation:
The text was updated successfully, but these errors were encountered: