Support the ongoing development of Laravel.io →
Blade Validation
Last updated by @ajax30 2 years ago.
0

This has nothing to do with your backend. You can manually open the modal after refresh if the form has errors.

@if(session()->has('error'))
    <script>
        $('#add_post_modal').modal('show');
    </script>
@endif
0

There is no jQuery in Bootstrap 5. :(

0

It doesn't have jQuery, but the concept is the same. You can use plain JS or check Bootstrap's doc on how to do it.

0
Solution

Try this out:

@if(session()->has('error'))
    <script>
            var myModal = new bootstrap.Modal(document.getElementById('add_post_modal'));
            myModal.show();
        </script>
@endif

Link to the official bootstrap 5 documentation manually open modal

0
Solution selected by @ajax30

@faisal Please help me with this quetion too. Thanks!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Razvan ajax30 Joined 2 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.