Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Looks to me as if the first item in radio button options list is selected by default.
Sure, I can make it so that it won't show any results at first (Require input before results are shown), but then again... in this case, the first option would be selected with no results are shown...
As a workaround I can enable the - Any - option (have it selected by default) and hide it with CSS, but maybe there is a better solution after all?
Ideally I'd like to have those radio buttons with none of the options selected by default.
Any ideas? Thanks,
Comment | File | Size | Author |
---|---|---|---|
drupal-views-bef-first-option-selected-by-default.png | 5 KB | mareks |
Comments
Comment #1
mareks CreditAttribution: mareks commentedComment #2
mareks CreditAttribution: mareks commentedComment #3
mikeker CreditAttribution: mikeker commentedThe only way to get rid of the "any" option is to make the filter "Required" and doing that means you have to select a default option, else Views throws an error when you save the filter config dialog. If you select a default option, that'll be what's initially selected when you view the display.
It's an interesting idea to add a "unselect all radios and hide -any- if -any- is selected" which to what you're asking for, right? Though I would likely implement it similar to what you were suggesting: hiding the -any- option with CSS...
Comment #4
mikeker CreditAttribution: mikeker as a volunteer commentedIssue queue cleanup...