Skip to content

Instantly share code, notes, and snippets.

@mgladdish
Last active June 13, 2018 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgladdish/bb9cc77239d723f577531d9756554531 to your computer and use it in GitHub Desktop.
Save mgladdish/bb9cc77239d723f577531d9756554531 to your computer and use it in GitHub Desktop.
section(
messages = "sectionText", // the name of properties bundle containing section-level text
nestingCheckboxes(
"myCheckboxes", // the unique name of our widget
"questionWording", // the name of the properties bundle containing text for the widget
required, // constraints applied to the widget
"contactMethods", // the name of the properties bundle containing the key and labels for each checkbox choice
Map( // our nested widgets
"EMAIL" -> // the key from contactMethods with which to associate this nested iwdget
nestedInput(
"email", // the unique name of the input text widget
"questionWording", // the name of the properties bundle to fetch text for the widget
required, // constraints applied to the widget
showWhenWidget("myCheckboxes") hasValue "EMAIL" // make this widget visible only when the "EMAIL" checkbox is selected
),
"PHONE" -> nestedInput("phone", "questionWording", required, showWhenWidget("myCheckboxes") hasValue "PHONE"),
"TEXT" -> nestedInput("text", "questionWording", required, showWhenWidget("myCheckboxes") hasValue "TEXT")
),
asColumn // display the checkboxes in a vertical column, rather than in a horizontal row
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment