Superform by Delta Clan
✨ ClonablesSocialResourcesSuperform Home
v2
v2
  • 🏁Getting Started
    • Introduction
    • Quick Start
  • 🫀Essentials
    • Form Container
    • Step Container
    • Navigation - Overview
      • Direct
      • Logic / Conditional
      • Hook
    • Variables
      • Form Data ($f)
      • Step Index ($s)
      • Progress Percentage ($p)
      • Scoring Variables ($v)
    • Progress Bar
    • Reset
    • Radio Groups
    • Checkbox Groups
    • Cheatsheet
  • ⚙️Global Options
    • Step Delay Controls
    • Animations
      • Step Animation
      • Step Animation Duration
      • Step Animation Ease
    • Save Data & Progress
    • Pre-fill Form
    • Prevent Content Flash
    • Debug
    • Third-party Integrations
    • Cheatsheet
  • 🎛️Input Validation & Errors
    • Validation
      • length()
      • words()
      • minmax()
      • checkbox()
      • must()
      • hook()
    • Error Management
      • Automatic Error Setup
      • Manual Error Setup
  • ⚡Reactivity
    • Update Text
    • Visibility
    • Class Toggle
    • Value
    • Set Attribute
  • 🔢Score Tracking
    • Score Setup & Calculation
    • Score Ranking
  • ⌨️Accessibility
    • Enter & Backspace Bindings (↩, ⌫)
    • Checkbox & Radio Bindings
  • 🛠️Javascript SDK
    • Intro to Superform API
    • Superform Instance
    • Cheatsheet
  • 📖Additional Resources
    • WTF is an expression ? 🆕
    • Integrations
    • Tutorials
    • Changelog
    • FAQ 🚧
    • Join Discord
Powered by GitBook
On this page
  • Setup
  • Defining a Checkbox Group

Was this helpful?

  1. Essentials

Checkbox Groups

Efficient multi-checkbox management.

Checkbox group attribute simplifies managing multiple checkboxes by grouping them together and applying validation and navigation controls seamlessly.

Setup

Attribute: sf-checkbox-group

Value: myGroupName (e.g., "someOptions")

Where: Applied to the container element of a group of checkboxes.

Keyboard Navigation

By default, keyboard navigation number (0-9) is enabled for a checkbox group.

→ Check more in Checkbox & Radio Bindings.


Defining a Checkbox Group

In this example we are creating a checkbox group and apply a validation of minimum 2 and maximum of 4 options that are allowed.

HTML Example

index.html
<div sf-checkbox-group="someOptions" sf-validation="checkbox(2, 4)">
  <input type="checkbox" name="option1"> Option 1<br>
  <input type="checkbox" name="option2"> Option 2<br>
  <input type="checkbox" name="option3"> Option 3<br>
  <input type="checkbox" name="option4"> Option 4<br>
  <input type="checkbox" name="option5"> Option 5<br>
  <input type="checkbox" name="option6"> Option 6<br>
</div>

Webflow Example

Dos and Dont's


Do ✅:

  • Ensure all checkboxes within the group have the same name.

  • Use sf-checkbox-group to manage validation collectively.

Don't ❌:

  • Use different names for checkboxes within the same group.

Last updated 9 months ago

Was this helpful?

Target the group with sf-error for error handling. Use the name of the group as the value for the sf-error attribute (see ).

🫀
Setup - Error Binding