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.

Ruby on Rails Blog Live Ajax Comments Previewing

It seemed strange to me that there was no default asynchronous comments on this web spiffy blog and I was never a huge fan of preview buttons myself so I hacked in a live preview! Go ahead and give it a whirl. This very simple code can be used for far more then the blog app typo that runs this site. It can observe any form you have on your sites or projects.

To implement it an your own blog, edit app/views/articles/_comment_box.rhtml and do the following: