Answers for "how to prevent multiple clicks on submitting button in laravel"

PHP
0

how to prevent multiple clicks on submitting button in laravel

Step 1: write a class name in the form tag Exp: "from-prevent-multiple-submits"
 <form class="pt-4 from-prevent-multiple-submits" action="{{ route('messages.store') }}" method="POST">
 @csrf
  
Step 2:
Write a class in button section
<button type="submit" id="submit" class="btn btn-primary from-prevent-multiple-submits">{{ translate('Send') }}</button>
  
Step 3:
write this script code

    <script type="text/javascript">
    (function(){
    $('.from-prevent-multiple-submits').on('submit', function(){
        $('.from-prevent-multiple-submits').attr('disabled','true');
    })
    })();
    </script>
Posted by: Guest on September-30-2021

Code answers related to "how to prevent multiple clicks on submitting button in laravel"

Browse Popular Code Answers by Language