How to set up conditional visibility on form blocks based on custom field selections without data persistence issues? Answered

Post author
Shadi null

Is there a way to set up conditional visibility on a form block? I don’t want it to be plan specific, I need it to be custom field specific.

So while they fill out their profile, I want a different section of the form to appear depending on what they selected on a custom field in a previous section of the form.

So for example, if someone wants cake, they’re unlikely to want to add pickles ontop, so I would like to remove the veggies option in a form section below where they chose cake (just a hypothetical example)

Comments

5 comments

  • Comment author
    Josh Lopez

    I think you may be able to do this after watching Connor Finlayson’s video here. This isnt a Memberstack specific thing because the form hasnt submitted yet so Memberstack doesnt know what the values are.

    0
  • Comment author
    Shadi null

    Awesome!!! Thanks for the great lead! I’ll give it a look at now :)

    @Josh Lopez this is a great resource! However I have a question/concern with this method.

    If for example someone selects pizza (as the conditional) and starts adding toppings like Peperoni (visible cuz they chose pizza), but then after choosing some toppings they decide they’d rather have cake. While it does hide the toppings they chose (visually) they’d still be getting a cake with Peperoni as the toppings options they chose are now only hidden and not removed in the output data.

    Is there a way to avoid this scenario?
    I hope im making Sense. 

    0
  • Comment author
    Josh Lopez

    Connor Finlayson have you ran into this issue? My first thought is that it would need some custom code that would refresh the form if another top level option was made but wondering your thoughts.

    0
  • Comment author
    Connor Finlayson

    That is hard to do because you would immediately need to update Memberstack in order to use attributes to set the visibility of the form (which you wouldn't do until form submission). You could do it with Jotform and prepopulate the form with data attributes.

    0
  • Comment author
    A J

    Hello future readers,

    Here's a memberscript that will help you show fields in a form based on the dropdown value selected by the user.

    Hope this helps.

    0

Please sign in to leave a comment.