Use case: I have a site that allows users to input their gender as "Male" "Female" or "Other" (using select or other).

I was hoping to expose this field as a filter criterion in views to allow users to filter based on gender. However, the filter criterion for select or other fields appears to be the standard text filter. I would like to expose this filter and allow users to search for "Male" "Female" or "Other" (the options provided when the field is created) using a select box (however, in this case the "Other" would not prompt for input but rather point to all values other than "Male" and "Female").

Of course, users can search as is by typing "Male" or "Female" each time, but from a usability standpoint this is not ideal.

Thank you for your consideration.

Comments

danielb’s picture

A select (or other) form input will tend to behave more like a textfield than a select box in integration with other modules because of the nature of it's functionality.
I'm not interested in working on changing this myself, if it is even possible, as I don't need it, but I would be willing to accept patches.

danielb’s picture

danielb’s picture

Status: Active » Closed (duplicate)
SchwebDesign’s picture

The best way i found to do this was by using Select or other with taxonomy term reference, rather than text field. There's at patch here that allows for that: https://drupal.org/node/1716764#comment-7553097)

This then will allow you to have a select list/drop down of allowed values if exposing this as a filter in a view.

I believe 'converting' your text field input to being taxonomy terms instead is the best solution for this, at least it was for me. (one good way to do that is here: https://drupal.org/node/215472#comment-2086422 )