Override a Views Exposed Form

By peterm, 10 October, 2009

Tags

For the Title and Pay Plan application, I had been using the standard views filtering to display a paginated result set of several hundred rows formatted as a table. As you know, the standard Views UI form uses a text field to accept user input. The clients didn't want to have users type, but rather select from a drop down menu.

So what we wanted to override was the text field in the view and use a select element. Turns out it isn't as easy as it sounds. First you need to have enough knowledge of the Drupal way to ask a question or search google. Around this time I was reading lots of Drupal books and started to understand what terms intercept and override meant.

I had posted a question to the drupal forums asking for help, http://drupal.org/node/463990 and over time have gotten lots of good ideas. I ended up using a custom module approach to override the text field with a select field. Here's a picture of what the resulting form looks like.

Image