Disabling Submit Button onClick

Sometimes I want to disable the submit button on click so that someone with slow internet doesn't submit a form multiple times.

The fastest way to do it is this

<input type="submit" value="[Value]" class="[Classes]" name="[Name]" onclick="this.disabled=true;this.form.submit();" />  

This will disable the button and submit the form that it is a part of

More advanced

Passing a value on submit

<input type="hidden" name="action" id="[Id]">

<input type="submit" value="[Value]" class="[Classes]" name="[Name]" onclick="this.disabled=true;document.getElementById('[Id]').value = this.value;this.form.submit();" />  

This will set the hidden field to have the same value as the button and pass the data to the Controller.