Support

Home Forums Event Espresso Premium Conditionally hide/show a question group based on a drop down question value

Conditionally hide/show a question group based on a drop down question value

Posted: November 20, 2018 at 4:21 am

Viewing 1 reply thread


Porter

November 20, 2018 at 4:21 am

Hi there

I’ve had a look at the code on to hide/show questions based on a text question:
https://gist.github.com/joshfeck/183209d5239cc07ec94f9ebbfb017d40#file-functions-php

However, I need to hide an entire question group. The class used in the div is used for all the question groups and the id is always different for every event. For example, the 96 below is different for every registration.

<div id=”ee-reg-form-qstn-grp-Company-Information-96″ class=”ee-reg-form-qstn-grp-dv”>

Is there a code example to do this on Github? I am assume it needs some regular expression for this?

Thanks


Josh

  • Support Staff

November 20, 2018 at 6:56 am

Hi,

CSS (and jQuery) allows for partial matches when you use attribute selectors:
https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

e.g.

div[id^=\'ee-reg-form-qstn-grp-Company-Information-\']

Viewing 1 reply thread

The support post ‘Conditionally hide/show a question group based on a drop down question value’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso