Validation in a Modal #2055
Replies: 3 comments
-
@cjmellor It's difficult to help when the snippets you provide can't be copy/pasted to reproduce the issue. Your code has external dependencies such as a VoiceIsolation model, etc. If you could provide a snippet (e.g. Volt component), without any undefined dependencies, that reproduces the issue, it would make it easier for people to try to help. |
Beta Was this translation helpful? Give feedback.
-
I use validation inside a modal and it works, as @jeffchown says it's hard to pinpoint the problem without a Volt component. This is a blind guess, but I note you're using |
Beta Was this translation helpful? Give feedback.
-
I figured it out, it was my code, I had a rogue |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I was just attempting to build something where I click a Menu Item from the Dropdown component and this opens up a Modal. Inside the Modal is an Input (text) field and a Submit Button.
Clicking the submit button fires a function (
wire:click="renameFile($id)"
) which checks for validation at the start via$this->validate()
. Now, the issue here isn't that it isn't validating, it is that when I click the Submit button, the Modal closes and I don't get to see the validation under the input field like I might expect to.My code, for context:
My guess is the Modal will close by default on the submission of a button?
Any guidance on how best to achieve this is appreciated!
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions