Toggle menu

Vertical Layout - Accordion

Layout fields hold other fields. They can also have borders, labels and hints. The vertical accordion layout expands and collapses using two CSS classes, icmverticalaccordion--open and icmverticalaccordion--closed

Custom Functions

Custom functions can be called from the handlers of other fields using .invokeCustomFieldFn.

  • expandAccordion(showAnimation) - call this function to expand the accordion. showAnimation - boolean. true to play the animation
  • collapseAccordion(showAnimation) - call this function to collapse the accordion. showAnimation - boolean. true to play the animation
  • getState - check the current state of the accordion. Returns "EXPANDED" or "COLLAPSED"

Animation

By default the accordion expands and collapses with an animation. You can expand or collapse the field without the animation when calling its custom function. For example, the following could be added to a script button to open the accordion.

function(helper) {
    helper.invokeCustomFieldFn("ACCORDION", "expandAccordion", false);
}

Properties

LabelDescriptionType Name
LabelThe label for this field. Leave this property blank to not output a labelLABEL
Show BorderWhether to show a border around this field or not. This property adds/removes a class on the field. The styling itself is controlled by the site's stylesheetSHOWBORDER
ShowSets when the container and the fields within it should be output.

The following options are available:

Always - the HTML will always be output.
Form - the HTML will only be output when the page HTML is being rendered on the site (in 'standard' mode).
Summary (Email) - the HTML will only be output when the page HTML is rendered in read only mode, without controls. For example, in emails

SHOW

CollapsedWhether the layout field is collapsed or expanded by defaultCOLLAPSED
Collapsed FunctionA server-side JavaScript function that can dynamically set the collapsed/expanded state of the accordion. Return "collapsed" or "expanded" to override the default in the Collapsed propertyCOLLAPSEDFUNC
HintAdditional information displayed alongside the field to assist the user in completing it. The value of another field can be used by adding the field's name between # characters. See Common Field Properties for more informationHINT
Hint VisibilityWhether the field hint is visible when the layout is collapsedHINTVISIBILITY
Additional Styling ModifierAn optional CSS modifier for the field. See Common Field Properties for an exampleADDITIONALSTYLINGMODIFIER
DocumentationAdd documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an exampleDOCUMENTATION
Last modified on 9 March 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon