F
Filament3w ago
Ali

Custom form not validating last wizard step.

As you can see the first steps on my wizard get validated correctly upon clicking "next". But upon clicking submit on the last step. It just triggers the submit function i put with wire:click on the submit button, without validating the captcha or the checkboxes. Thank you for your help.
No description
No description
No description
10 Replies
Ali
AliOP3w ago
Btw here's a screenshot that shows my submit button alongside the submit function
No description
LeandroFerreira
did you add the mount method?
Ali
AliOP3w ago
Hello, thanks for the quick reply. Yes i have it to fill the form
No description
Ali
AliOP3w ago
I found out how to validate the last step I have using this in my submit function. Care to explain why the behaviour is like this ?
No description
LeandroFerreira
$this->form->getState() will validate the form
Ali
AliOP3w ago
On top of the ->rules() i have put alongside required() or accepted() you mean ?
LeandroFerreira
on the top of the rules, what does it mean? you should add validation to the fields..
Ali
AliOP3w ago
For example, my third step, i have ->accepted() and ->required()for my checkbox. as you can see, If i comment the code inside the submit function it would not trigger the rules of the checkboxes WHICH are on the last step. That has been my issue all along
No description
LeandroFerreira
sorry, I didn't understand what you are trying to do. As I mentioned, $this->form->getState() will validate your form..

Did you find this page helpful?