Manually mark input with error
Hi! Is there any way i can mark a field as if it has an error. So for example when manually triggered i want to make it as if has a custom error.
Solution:Jump to solution
Okay, so trying what you said I achived it by calling $this->addError directly on the livewire class
6 Replies
"mark", what does it mean?
So that i can manually trigger a validation error
For example if i want a textinput to be red because it's discrepant with the data in the database or a fixed value, i want to manually be able to trigger that input's validation error
I think you can inject
$livewire
and use $livewire->addError('field', 'message')
or data.your_field
https://livewire.laravel.com/docs/validation#manually-controlling-validation-errorsLaravel
Validation | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Will try, thank you!
Solution
Okay, so trying what you said I achived it by calling $this->addError directly on the livewire class
Thank you!