views:

19

answers:

1

I'm displaying cars on a page created with a view and displays. I want to be able to create a form on the home page to allow people to select the 'make', which will then update the 'models' list based on the 'make' the user selects, 'year' to and from, and 'amount' to and from. What the user selects will of course alter the list of used cars, whether that's on the existing used cars page or a new page.

I would be happy to create a custom module if required, just need some direction.

Thanks !

+2  A: 

When using views, what you need to do is to use exposed filtes. Inside your view you can setup filters like normally, only when you expose them, the user get to change the value of the filter.

How the filters will be themed to the user will depend on how you store the values, so it's a bit hard to say how to progress from there. It might be a bit tricky to get a select and not a textfield. Once you get select fields, this could probably be done with either some theming or form_alter, all you need is to add some js to change the options. The js part should be pretty normal, you will probably need to fetch the model names and values using ajax.

googletorp
Thank you very much, managed to get it all sorted
Dallas Clark