Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some background info:</p> <ul> <li>Disabled form data such as disabled submit buttons will not be posted back to the server: <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.12.1" rel="nofollow">http://www.w3.org/TR/html4/interact/forms.html#h-17.12.1</a></li> <li>If a form contains multiple submit buttons only the clicked ones value will be posted back to the server: <a href="http://www.w3.org/TR/html4/interact/forms.html#successful-controls" rel="nofollow">http://www.w3.org/TR/html4/interact/forms.html#successful-controls</a></li> </ul> <p>If you want to disable all buttons so they are no longer clickable but still want to know what the user clicked the only solution I can think of is a hidden field along with this code:</p> <pre><code>$(function() { $('input[type=submit]').click(function() { var form = $(this).closest('form'); form.find('#hiddenField').val($(this).val()); form.find('input[type=submit]').prop('disabled', true); }); }); </code></pre> <p>If you just want to make sure the user cannot click the other buttons after clicking one you can do this:</p> <pre><code>$(function() { $('input[type=submit]').click(function(event) { $(this).closest('form').find('input[type=submit]').not(this).prop('disabled', true); }); }); </code></pre> <p>Unfortunately there is no solution (I know of) to bind a handler to the form´s submit and determine which input was clicked. This is not a problem related to your question but makes the above code slightly more complicated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload