I need to validate the checkboxes when the submit button is clicked, based on a specific condition. There are four checkboxes, and before submitting the form, the user must check at least one. However, instead of using FormLayout, I’ve created the form using CardLayout and local variables. I’m looking for suggestions on how to improve or streamline this approach.
FormLayout
CardLayout
Discussion posts and replies are publicly visible
You could try this:
a!localVariables( local!selected, { a!checkboxField( choiceLabels: {"Option 1", "Option 2", "Option 3", "Option 4"}, choiceValues: {1, 2, 3, 4}, label: "Checkboxes", labelPosition: "ABOVE", value: local!selected, saveInto: {local!selected}, required: true, requiredMessage: "You should select at least one option", validations: {} ), a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Button", style: "OUTLINE", validate: true ) }, align: "START", marginBelow: "NONE" ) } )