Reputation: 3
I've created a two modals on one page. One for login and second for register. Unfortunately, after validation $error name's are the same so script open two modals at one time.
Any ideas how to open register/login modal after validation?
To open modal I use this code:
@if ($errors->any())
<script>myModal.show();</script>
@endif
but it do not recognizes from which modal it error.
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
Upvotes: 0
Views: 126
Reputation: 1
You can name different error bags. Check out https://laravel.com/docs/8.x/validation#named-error-bags for more info.
Upvotes: 0