• Resolved dimaivanov84

    (@dimaivanov84)


    Hey team.

    I’ve stumbled across an issue with a form (currently on https://kpi.works/industry-anzsic-code/) that I built using this plugin. The form operates on 4 “levels”, the first being a simple “select” operator using a list, and levels 2, 3 and 4 being conditional on the selection in a previous level.

    Please repeat the fault yourself to see what I mean:

    1. On the page I link above, select the top option in all 4 sequential steps: step 1 (A), then step 2 (A01), then step 3 (A011) and finally step 4 (A011100)
    2. Next, change the “step 1” option from (A) to (B)
    3. Step 2 automatically updated itself to present a blank, and the drop-downs within step 2 changed to the new available options. This is CORRECT, and all good here.
    4. However, step 3 and step 4 are “stuck” based on the initial selection.

    By changing the selection in step 1 from (A) to (B), I expected the step 2 to refresh (which is did – success!), but I also expected the steps 3 and 4 to disappear completely, as there’s nothing preceding them – but these steps stayed behind.

    Can you please assist get the form to function as per my expectation, if possible?

    Many thanks for your feedback in advance,
    Dima ??

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    Hi Dima, this is what I would refer to as cascading drop down lists. The plugin (both PRO of FREE) are not optimized for this use case. You would need a lot of conditions. Like for example, at level 3 and 4 you would need to create a lot of AND conditions or nested groups.

    I’ve written a small tutorial on how to get these cascading lists working with some custom JS for now: https://bdwm.be/how-to-create-dynamically-populated-cascading-dropdown-lists-for-contact-form-7/

    Should you not feel comfortable implementing this yourself and you are thinking of hiring a developer, you are free to send me an email and I’ll send you a quote.

    Thread Starter dimaivanov84

    (@dimaivanov84)

    Hi Jules,

    Wonderful! Thank you for your prompt response, and your offer of help. One of my main objectives is to keep the footer.php as light as possible to decrease page load times across all pages on the site, so I tried to configure your plugin properly, even if it’s more work initially.

    Luckily, with your hints, I’ve got cascading running perfectly using Excel scripts, Notepad++ and the FREE plugin! Thank you ??

    For anyone with a similar goal to mine, here are some tips on achieving it:

    1. Use the “clear_on_hide” flag for the groups, so if the user changes a higher-step, the form forgets the previously-selected lower step.

    e.g.
    [group A clear_on_hide]

    2. Not related to this plugin as such, but to make the form more personal, one of Jules’ tutorials shows a script using the “first_as_label” script after the CF7 “select” operator – this replaces the “—” if you use the “include_blank” operator with a custom message, which I think is better user experience.

    e.g.
    [group A clear_on_hide]
    [select A first_as_label “– Please choose –”
    “option1”
    “option 2”
    ]
    [/group]

    3. Jules’ suggestion of using lots of AND conditions worked beautifully, albeit a bit of work in Excel to write up. The only tricky bit was figuring out why it wasn’t working straight out of Excel, where I was using CONCAT to generate a very long string. I found that for this plugin to accept AND conditions, they needed to start on new lines. So, I pasted the 1000+ row Excel script into Notepad++ and using Replace (Search mode = Regular Expression, with Wrap Around checked), searching for “and if ” – I replaced all with “\r\n and if ” – this added a line-break, and, enough spaces in front of an AND for this plugin to work.

    e.g.
    This was output after Notepad++ edits, and will work:

    show [success-message-G392200] if [G392] equals “Tyre Retailing (G392200)”
    and if [G39] equals “Motor Vehicle Parts Retailing (G392)”
    and if [G] equals “Motor Vehicle and Motor Vehicle Parts Retailing (G39)”
    and if [industry] equals “Retail Trade (G)”

    While this text straight out of Excel will not work, although the text is the same:

    show [success-message-G392200] if [G392] equals “Tyre Retailing (G392200)” and if [G39] equals “Motor Vehicle Parts Retailing (G392)” and if [G] equals “Motor Vehicle and Motor Vehicle Parts Retailing (G39)” and if [industry] equals “Retail Trade (G)”

    Plugin Author Jules Colle

    (@jules-colle)

    Thanks for sharing your solution!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Groups in third and higher levels don’t update when root level changes’ is closed to new replies.