How to close action confirmation modal after form validate fails?
I have a custom livewire component that has a form with rules and submit action.
The problem is when there are validation errors, I cannot close this confirmation modal automatically.
Solution:Jump to solution
I found a way to close the modal window - after the confirmation button is clicked. Here is my action
```
public function myAction(): Action
{...
6 Replies
I have a similar use case that I need to disable action upon validation
I am losing my head on finding solution for this one π
Did you find a solution to this?
Solution
I found a way to close the modal window - after the confirmation button is clicked. Here is my action
This seems to work for me, if it passes validation, goes through the action. If it fails validation, the modal window is closed and shows validation window.
Probably, naming could have been better! I guess that I should call it confirmedAction or something similar. I can put it in a trait and use it any place.
@Anish Thank you so much! this worked on my end!
Glad it worked