When a user clicks on a button to submit a form, if they don't receive any feedback that the click was successful, they are likely to click the button again, resulting in a double form submission. Disabling buttons or the form when a button is clicked can introduce browser compatibility issues, as some browsers will interpret this as a request to cancel the form submission.
In this recipe we will create a Visualforce page that allows a user to edit some basic information about a contact. When the user clicks on the Save or Cancel button to save or discard their changes, the buttons will be swapped out with a pair of disabled buttons containing text to indicate that the form submission is taking place.
This recipe uses the jQuery (http://jquery.com/) JavaScript framework to swap the buttons. The JavaScript file is included from the Google Hosted Libraries content delivery network rather than being uploaded as a Salesforce static resource, as this makes...