F
Filament17mo ago
ZedoX

TagsInput Validation

How can i apply a validation rule to individual tags, of a TagsInput.
Forms\Components\TagsInput::make('tags')
->alphaDash(), //This always fail
Forms\Components\TagsInput::make('tags')
->alphaDash(), //This always fail
10 Replies
ZedoX
ZedoX17mo ago
Found a method called ->nestedRecursiveRules, that seems to work but it does not display the validation error.
Forms\Components\TagsInput::make('tags')
->nestedRecursiveRules('alpha_dash'),
Forms\Components\TagsInput::make('tags')
->nestedRecursiveRules('alpha_dash'),
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Dan Harrin
Dan Harrin16mo ago
it should display a validation error when the form is submitted
ZedoX
ZedoX16mo ago
Maybe because the form I tried is in a modal?
Dan Harrin
Dan Harrin16mo ago
should work
ZedoX
ZedoX16mo ago
Hi it won't stop you from adding tags, but will prevent saving My issue was, validation does indeed work as expected, but the error wasn't display on the input
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
ZedoX
ZedoX16mo ago
Why not SelectFilter with ->multiple() and ->relationship()
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
jaocero
jaocero8mo ago
Is there any solution for this? as you can see the recursive validation is broken
No description