Answers for "form submitting twice php"

PHP
0

form submitting twice php

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-29-2021
0

form submitting twice php

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-29-2021

Code answers related to "form submitting twice php"

Browse Popular Code Answers by Language