F
Filament12mo ago
Gustave

Form validation in Livewire component

Hi guys, I have a form in a Livewire component with a simple textInput. I don't know why but some Validations work (emai, required,...) but several others are ignored (alpha, filled, regex, etc...) I have the impression that the validations that work are basic html validations, but I don't know how to make the rest work. thanks for your help
1 Reply
jeph
jeph12mo ago
We have the same problem. Yours will probably work by adding ->validate() before you use the form data. Ex.
public function submit(): void
{
$this->form->validate();
.....
}
public function submit(): void
{
$this->form->validate();
.....
}
But mine wont work. The problem with my code is that i combine form and table in one component.. $this->form->validate() Just didn't work. It probably have conflict variable with $form.
Want results from more Discord servers?
Add your server