Switch (>1.2.17)

Switch (switch)

beta

This field allows you to set the value true or false. Allows advanced use when creating dynamic form logic.

image-1676548009966.gif

 

{
  "size": "s12 m5",
  "type": "switch",
  "id": "Switch",
  "hidden": false,
  "otrs_visible": "all",
  "order": 3,
  "tooltip": null,


  "icon": "assignment_ind",
  "icon_spacer": false,

  "label": null,
  "label_true": "Składam wniosek w <strong>czyimś</strong> imieniu",
  "label_false": "Składam wniosek w <strong>swoim</strong> imieniu",

  "validate": [],
  "disabled": false,
  "value": false
},

 

Additional features

Icons

You can add your own icon, you can not add an icon, but still keep the spacing, this will make your form more aesthetically pleasing.

 
Default

Turning on the icon shows one icon.

"icon": "assignment_ind",

image-1676548455230.png

 
Without icon

Disabling the icon will not display any icon or spacer.

"icon": null,

image-1676548496076.png

 
Without icon, but with spacer

The system generates an automatic space in place of the icon.

"icon": null,
"icon_spacer": true,

image-1676548540990.png

 

Labels

This field allows you to define labels more precisely. We can enable the default label (as in any other field), but we can also set the content of the label depending on the state of the field.

 
Default

This is the default setting and behaves like any other field.

image-1676549443291.gif

"label": "Składam wniosek w swoim imieniu",

 

Dependent

This setting will change the button's label depending on the current state.

image-1676549705853.gif

This parameter also accepts most html tags, e.g. <strong>

"label": false,
"label_true": "Składam wniosek w <strong>czyimś</strong> imieniu",
"label_false": "Składam wniosek w <strong>swoim</strong> imieniu",
 
Styles

The color scheme of the button and its behavior can be customized in the configuration file found here: /FORMS/styles/custom_style.css

image-1676550224793.pngimage-1676550176028.png

 

The rest of the available parameters:

This field supports all parameters with "Attributes available for each field".