how to prevent multiple clicks on submitting button in laravel

Solutions on MaxInterview for how to prevent multiple clicks on submitting button in laravel by the best coders in the world

showing results for - "how to prevent multiple clicks on submitting button in laravel"
Aya
27 Jan 2016
1Step 1: write a class name in the form tag Exp: "from-prevent-multiple-submits"
2 <form class="pt-4 from-prevent-multiple-submits" action="{{ route('messages.store') }}" method="POST">
3 @csrf
4  
5Step 2:
6Write a class in button section
7<button type="submit" id="submit" class="btn btn-primary from-prevent-multiple-submits">{{ translate('Send') }}</button>
8  
9Step 3:
10write this script code
11
12    <script type="text/javascript">
13    (function(){
14    $('.from-prevent-multiple-submits').on('submit', function(){
15        $('.from-prevent-multiple-submits').attr('disabled','true');
16    })
17    })();
18    </script>
19
20