Closed robdekort closed 9 months ago
A workaround is using 'required_if:{this}.numbers,true'
as the validation rule.
This is working as intended.
You have the number
field set to always_save: true
, which means it will always be submitted. Any submitted field will pass the sometimes
rule, and therefore your required
rule kicks in.
You can either disable always_save
, or use the required_if
validation rule like you found out.
Oh Wow I would've never guessed that. Makes sense-ish though. Thanks for the explanation.
Bug description
I someimes see
required sometimes
triggering validation when it's hidden. Here's an example: https://github.com/statamic/cms/assets/69107412/0aa600a8-21e2-45ac-a86b-43d6ceb757d0How to reproduce
This is a nested situation. It's probably easiest to:
php please add-block
Logs
No response
Environment
Installation
Starter Kit using via CLI
Antlers Parser
Runtime (default)
Additional details
No response