This is the documentation for ConfiForms Server/Data Center appHowever, this might also work for ConfiForms cloud and in most cases it does. But please see this page to understand the differences between server and cloud versions of the ConfiForms app.
Simple tutorial on how to use ConfiForms Field Definition Rules#Showcontainer and it's counterpart ConfiForms Field Definition Rules#Hidecontainer ConfiForms Rules for Field Definitions to show and hide visual blocks in your forms conditionally
These rules are usually used with custom layouts, where you have your own layout defined for the form and want to show or hide blocks of fields conditionally
Consider a form that has few fields like this
Custom layout for the same form
|Using our Div container user macro||Using div macro from Content Formatting Macros for Confluence by Adaptavist|
Please note that Div container user macro we have has certain limitations due to the way how user macros are rendered in Confluence. If you can use other macro that can be addressed via CSS then it is advisable to use that
As you can see, our form has 5 fields and 2 rules. Actually there are 4 rules, as each of the 2 rules has a "reverse rule" automatically created. That works for show/hide rules very well and you do not need to create an extra reverse rule yourself.
Our 5 fields are:
- Field1 - simple text field (does not really needed here, but added to show a simplest field possible - no rules, no behaviour)
- showDetails - is a checkbox field and that manages the visibility of the other field named "details"
- details - textarea field that is shown only when the checkbox "showDetails" is checked
- options - is a dropdown field with 4 options, 4th option manages the visibility of the "userOption" field
- userOption - is a text field that is shown only when someone has selected an option with ID=4 in the "options" field
Now let's see the 2 rules that add the dynamics to our form:
|Rule 1||Rule 2|
First rule is "bound" to field "showDetails" and tracks for changes
It has a condition to check if showDetails field has value "true"
and we use CSS3 selector, by element id (more on CSS https://developer.mozilla.org/en-US/docs/Web/CSS)
As this is the name "mycontainer" we set to our DIV macro's ID parameter
See how it is configured here: How to show and hide fields in the form conditionally
Full configuration for the form in storage format
To import via Atlassian Confluence Source Editor