Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form checkboxes with required #11062

Open
AtmoFX opened this issue Nov 6, 2024 · 0 comments
Open

Form checkboxes with required #11062

AtmoFX opened this issue Nov 6, 2024 · 0 comments

Comments

@AtmoFX
Copy link

AtmoFX commented Nov 6, 2024

Bug description

Continuation to the recent, unanswered discussion: #10984

When adding the validation required to a Checkboxes field, the form cannot be submitted unless all the options are ticked. I cannot find a way to validate a checkboxes field so that the submission is accepted so long as I check at least 1 entry but not all of them.
The important thing pointed out by @stephenmeehanuk is that the behavior disappears when the hidden field is removed.

The reason I classify this issue as bug is because the behavior was apparently introduced by: #7180. It must have worked before.

How to reproduce

Create a form with checkboxes containing more than 1 option.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.30.0
PHP Version: 8.3.13
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: gaia-hub.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 3
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.36.0 PRO

Statamic Addons
alt-design/alt-seo: 1.2.1
jacksleight/statamic-bard-mutator: 3.0.3
statamic/eloquent-driver: 4.16.1

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Forms: file
Global Sets: file
Global Variables: file
Navigation Trees: file
Navigations: file
Revisions: file
Sites: file
Taxonomies: file
Terms: file
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants