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.
Hello,
I was wondering if it is possible to get conditional fields working for Views Exposed Filter?
Any pointers would be very much appreciated.
Thank you
Comments
Comment #1
mrlava CreditAttribution: mrlava commentedalso interested in this
Comment #2
jessefulton CreditAttribution: jessefulton commented+1
Comment #3
robby.smith CreditAttribution: robby.smith commented+1 this would be great!
Comment #4
rburgundy CreditAttribution: rburgundy commented+1 subscribing
Great module! Is this new feature something possible in the near future?
Comment #5
JordanMagnuson CreditAttribution: JordanMagnuson commented+1 subscribing.
Comment #6
sotiris CreditAttribution: sotiris commented+1 subscribing
Comment #7
kimlop CreditAttribution: kimlop commented+1 subscribing
Comment #8
pepeelfrances CreditAttribution: pepeelfrances commented+1 subscribing
Comment #9
dabblela CreditAttribution: dabblela commentedCheck out CTools and a hook_form_alter to set this up programmatically, though it would be cool if it could be done in UI.
Comment #10
rburgundy CreditAttribution: rburgundy commentedhi manatwo,
would you know of any good tutorials or a resource to learn how to achieve this with CTools and hook_form_alter?
if we could share examples in this issue thread it would be awesome!
thanks
Comment #11
wila CreditAttribution: wila commentedsubscribing !!
Comment #12
borjagut CreditAttribution: borjagut commented+ 1 subscribing!
Comment #13
YK85 CreditAttribution: YK85 commentedsubscribing
Comment #14
mrlava CreditAttribution: mrlava commentedlooks like this is nothing more than wishful thinking, wish i could write it and contribute it, good luck to anyone who tries, i've had no luck. would be really nice =D
Comment #15
druplicate CreditAttribution: druplicate commentedI solved it by using a simple jQuery script. In this case I have two radio buttons to select "Rent" or "Buy". This is controlling the visibility of sales or rental price range fields for Views exposed filters. Just place the jQuery script in your js directory in your theme, and list it in the .info file. Use this script as a guide and Google around for jQuery script examples for showing/hiding elements. That's what I did to come up with this script, not having any previous experience with jQuery. Easy enough to substitute your variables and modify anything else. You can also control animation effects with additional jQuery statements. The trickiest part was learning the details of moving action selectors up or down the DOM to find the appropriate trigger and target, but it's straightforward to do. MUCH easier to try/debug using the live script console in Firebug. Also, learned most of what I needed to do here by watching the Lullabot video on jQuery.
Comment #16
benone CreditAttribution: benone commented+1
Comment #17
not_Dries_Buytaert CreditAttribution: not_Dries_Buytaert commentedI too need to be able to configure a certain exposed filter to dynamically (dis)appear only if some other exposed filter is set to certain (!) values. I found this possible solution (which I have not tested myself yet): http://drupal.org/node/358019
Comment #18
creatile CreditAttribution: creatile commentedAlso interested
Comment #19
mErilainen CreditAttribution: mErilainen commentedI need to do the same, but my controlling field is taxonomy term list. If someone has an idea how to do it in Drupal, please do tell. I'll post here later with a solution if I have to go the jQuery way.
Comment #20
Berliner-dupe CreditAttribution: Berliner-dupe commented+1 subscribing
Comment #21
BManuel CreditAttribution: BManuel commentedhow do you find this "#edit-field-sell-rent-value-many-to-one-Buy" what part of the view does it refer to.
Thanks
Comment #22
druplicate CreditAttribution: druplicate commentedThat Views field is specific to the filters I had setup.
You would have some different fields to refer to for your application.
You can use Firebug to find the HTML with your specific tags.
Comment #23
Firnas CreditAttribution: Firnas commentedThanks druplicate @ #15 this helped me. What I had was kind of the same problem except that the 'Rent' & 'Buy' where options in a select element not buttons.
Here's how it worked for me, hoping it helps more ppl who want to show/hide filter based on select element values
Comment #24
Desi Raaj CreditAttribution: Desi Raaj commentedCould you please elaborate a little more on that, i don't know much php but will be able to swap out your fields with mine.also, does this go in templete.php?
My fields:
System:select list (always active) (allowed values PC, XBOX, PS3, Wii)
Video Type: select list (always active) (allowed values Strategies, Commentary etc)
Game: select list (depending on which game the user selects, the following fields will be determined) (values Black Ops, Modern Warfare 2 etc)
Game Types: (will depend on which game is choosen)
Maps: (will depend on which game is choosen)
I will really appreciate your help.
Comment #25
Tesmon CreditAttribution: Tesmon commentedSubscribe
Comment #26
peterpoe CreditAttribution: peterpoe commentedConditional Fields only works with CCK fields, it doesn't have anything to do with Views exposed filters.
I thinks that the functionality you need is included in Views Hacks: http://drupal.org/project/views_hacks (the Views Selective Exposed Filters module).
Comment #27
alioso CreditAttribution: alioso commentedFor a javascript solution, this is the one i use. '
It works better than the ones above and reset the hidden select to the first value on hide. Hope that can help someone.
Comment #29
mittalpatel CreditAttribution: mittalpatel commented@alioso_oopa
Yeah, it's working fine but only when Ajax is disabled. If Ajax is enabled then it displays all the filters even though we try to hide it using javascript. When Ajax is on, it loads the whole view again after processing the template file so all the filters will be displayed. Any idea how those filters can be hidden in this case?
Comment #30
warmth CreditAttribution: warmth commentedAny news about this? No patch or dev release including this option?
I'm having the same issue that mittalpatel and it seems to be a lack of ajaxComplete implementation but I can't make it work.
Btw, is this a duplicate of: http://drupal.org/node/358019?
Comment #31
warmth CreditAttribution: warmth commented#29 This should help: