Forums Forums Search & Filter Pro Conditional Logic

Viewing 10 posts - 1 through 10 (of 12 total)
  • Anonymous
    #40310

    Hello,

    How do I setup conditional logic with a form? I’d ideally like the dropdowns to change based on the option selected above. How do I go about doing that? Thanks!

    Trevor
    #40324

    Hi

    I am hoping this answer is right (Ross may chime in to confirm).

    The first thing is that the search form needs to be on the results page, and this (I think) means that you must be using (and the theme must be capable of being used with) the shortcode ‘Display results’ method.

    You would need to set the form to update as the user makes selections (General Settings Tab -> Auto Submit Form to checked [on]).

    Then, in the search form, in each element where there are likely to be options for the user to choose, make sure that ‘Hide Empty’ is checked [on].

    It may also help, on the Display Results settings tab, to have ‘Load results using Ajax’ checked [on], IF your theme supports it (it will be obvious when the user interacts with the form, the results will fade and reappear.

    Trevor

    Trevor
    #40326

    OTOH, if you mean, can you change which controls show based on options picked, this is not currently possible. My bad if I had misunderstood your question. I do not know if it is even possible or practicable.

    Anonymous
    #40377

    Hmm… Here’s an example, but I was hoping to do this with dropdowns. Notice how when you click an icon, it shows more examples based on that:
    http://www.wine.com/v6/aboutwine/pairingfoodwithwine.aspx?s=foodandwine&cid=foodandwine&state=CA

    Any recommendations on how to approach something like that?

    Trevor
    #40384

    That is what I meant by my second reply. They are called filter toggles (I think), and the answer is no, not yet. I cannot speak to the future as to whether a feature like that would appear.

    Ross Moderator
    #40398

    Hey Peter

    Something like that won’t work out of the box, but if you are knowledgeable with jQuery you could pull something similar off.. with a few tweaks.

    I’ll describe the general logic:

    1) You want to get your fields to react / update depending on the selection of another field. This is already possible – check the movies demo, and how how updating genre / film certificate updates the other field automatically – http://demo.designsandcode.com/sfpro-movie-reviews/

    To achieve this, make sure you enable auto count (in the settings box – general tab) and make sure you enable hide empty inside your fields

    2) This is the custom jQuery code you would have to write – but the logic is really not that complex:

    – hide all fields with CSS except the first field
    – with jQuery, check whenever an input field is updated – or if using ajax, simply check when an ajax request has completed (check first question here)
    – now you detect all changes in the fields, whenever there is a change, you would simply check to see if something has been set in the first field, if so, show the next field, if not hide the next field, and so on..

    Hope that helps anyway! 🙂

    Anonymous
    #40399

    Thanks Ross! I don’t know jQuery – would I be able to pay you to write it?

    If so, feel free to email me at pruchti [at] adeptplus [dot] com

    Trevor
    #40401

    Well, there you go!

    Ross Moderator
    #40403

    Hey Peter

    Thanks but I’m afraid the workload with S&F plugin is at an all time high – which means no taking on new projects I’m afraid 🙁

    Thanks

    Anonymous
    #40405

    Hi Ross,

    Could you email me with a price and we can make it happen? Willing to pay extra if thats what needs to be done to make this work

Viewing 10 posts - 1 through 10 (of 12 total)