Forums

Forums / Developing Portals / MVC Rules Manager - Show/Hide Section

MVC Rules Manager - Show/Hide Section

Thread is closed for posting
2 posts, 1 answered
  1. mbayes
    mbayes avatar
    17 posts
    Registered:
    29 Dec 2015
    23 Feb 2018
    Link to this post
     Hi There!

    I noticed in the Rules Manager form widget that there is a Show Section / Hide Section options. There is no documentation that I can find regarding these options.

    Is it possible to get a breakdown of how this functionality works? I'm guessing the hide/show section should allow us to bulk hide/show fields rather than one at a time.

    Thanks!

    Matt
  2. Adam Benoit
    Adam Benoit avatar
    23 posts
    Registered:
    01 Mar 2017
    Answered
    26 Feb 2018 in reply to mbayes
    Link to this post
    Hi Matt,

    Thank you for bringing the lack of documentation to our attention. We will update the documentation in the near future with this missing information.

    The Show/Hide/Toggle functionality of the rules manager works by setting an Id or a Class of an element on the page. This allows you to show/hide groups of fields. If the hidden fields are required, the form cannot be submitted. Be sure to remove the required flag from any fields you hide.

    The easiest way is to use
    the container  layout widget in the form designer and setting a class on it. Then put inside it any fields that you want to show/hide conditionally. Then create a rule and set the class name you set in the container layout widget.

    The value you set in the rules manager of Rules Manager is the CSS/jQuery selector. a '.' in the case of classes and a '#' in the case of Ids. So to hide a layout widget you set a class of "myContainer"  you would configure the trigger of the rule and set the action to be Show/Hide and the action value would be '.myContainer'.

    I hope this answers your question. Please let us know if you have any additional questions.

    Adam Benoit
2 posts, 1 answered