title: How to disable multiple submit buttons in a form
body: <p>I have an issue with one of my forms.</p>
  
  <p>The form has 4 submit buttons, and different actions are carried out depending on which button is pressed.</p>
  
  <p>Whenever I click one of the buttons, I want to disable all of the submit buttons, I managed to put together some code doing exactly that:</p>
  
  <pre><code>$('button, input[type=button]').click(function(e){
                  $('#btnGuilty').prop('disabled', true);
                  $('#btnWarning').prop('disabled', true);
                  $('#btnInnocent').prop('disabled', true);
                  $('#btnClose').prop('disabled', true);
                  $(this).parents('form').submit()
              });
  </code></pre>
  
  <p>My original problem was that the form no longer submitted when running this code, and that's what the last line fixes.</p>
  
  <p>Unfortunately it appears that when I do this, nothing really happens (the form is submitted, but data about the submit button being pressed is no longer sent).</p>
  
  <p>My question is how I can work around this issue? - What I really want is for the form to work in the same behavior it used to, but also disabling the buttons to prevent people from submitting the form multiple times, so maybe "extending" the click function seems like what I want to do, but from what I have read, this is not possible.</p>
  
  <p>My form code, just in case:</p>
  
  <pre><code>&lt;form class="form" method="post" action="
                          {{ route('judgeTicket', ['user_id' =&gt; $account-&gt;account_id, 'hash' =&gt; $utils-&gt;generateTicketHash($account-&gt;account_id), 'ticket_id' =&gt; $ticket-&gt;id]) }}"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;textarea class="form-control" rows="6" id="ticketDesc" name="description" placeholder="Description"&gt;&lt;/textarea&gt;
                              &lt;/div&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;select class="form-control" name="category"&gt;
                                      @foreach($categories as $cat)
                                          @if ($ticket-&gt;category == $cat)
                                              &lt;option value="{{ $cat }}" selected&gt;{{ $utils-&gt;translateCategory($cat) }}&lt;/option&gt;
                                          @else
                                              &lt;option value="{{ $cat }}"&gt;{{ $utils-&gt;translateCategory($cat) }}&lt;/option&gt;
                                          @endif
                                      @endforeach
                                  &lt;/select&gt;
                              &lt;/div&gt;
                              @if ($model-&gt;hasCachedPermission($group, 'do_single_tickets'))
                                  &lt;div class="form-group"&gt;
                                      &lt;div class="checkbox"&gt;
                                          &lt;label&gt;
                                              &lt;input type="checkbox" name="singleDecision" value="1"&gt;Single ticket decision
                                          &lt;/label&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              @endif
                              &lt;div class="form-group"&gt;
                                  &lt;button
                                          type="submit"
                                          class="btn btn-success"
                                          name="btnInnocent"
                                          id="btnInnocent"&gt;
                                      Innocent
                                  &lt;/button&gt;
                                  @if ($suspended == false || $suspended['Type'] == 'Mute')
  
                                      &lt;button
                                              type="submit"
                                              class="btn btn-danger"
                                              value="Guilty"
                                              name="btnGuilty"
                                              id="btnGuilty"&gt;
                                          Guilty
                                      &lt;/button&gt;
                                  @else
                                      &lt;button type="submit"
                                              class="btn btn-danger"
                                              value="Guilty"
                                              name="btnGuilty"
                                              id="btnGuilty"
                                              disabled="disabled"&gt;
                                          Guilty
                                      &lt;/button&gt;
                                  @endif
                                  &lt;button
                                          type="submit"
                                          class="btn btn-warning"
                                          value="Warning"
                                          name="btnWarning"
                                          id="btnWarning"&gt;
                                      Warning
                                  &lt;/button&gt;
                                  &lt;button
                                          type="submit"
                                          class="btn btn-default"
                                          value="Close ticket"
                                          name="btnClose"
                                          id="btnClose"&gt;
                                      Close ticket
                                  &lt;/button&gt;
                              &lt;/div&gt;
                              {!! csrf_field() !!}
                          &lt;/form&gt;
  </code></pre>