Disable Submit Button After its Pressed

Ever run into a problem where someone hits your apps submit button multiple times and it throws the app into a frenzy?

One solution for this would be to disable the submit button after it has been pressed. Ajax concepts are definetely maturing and i'd like to see more time spent simplifying these types of actions in rails. One of my qualms is that it is complicated to tie multiple buttons, their onclick actions and validation behind the scenes into one simplified process.

One thing to note is this seems to have errors in IE.

Needless to say, heres one version of code to disable the submit button:

<%= link_to_remote((submit_tag 'SUBMIT',
:onClick=>"this.disabled='true'"),
:update => 'preview', 
:complete =>"new Effect.Grow('preview'); new Effect.Fold('Wrapper')",
:url => {:action => 'foo', :id =>@params[:symbol]}) %>

Another way would be to do this:

<%= form_remote_tag(:update => 'preview'........ % >

 <%= submit_tag 'SUBMIT', :onClick=>"this.disabled='true'"%> \

# OR

<%= start_form_tag :action => 'update_category', :id => @category.id %>
<%= submit_tag "Edit Category", :onClick=>"this.disabled='true'" %>