Look in the comments to Vikas’ solution… much cleaner solution!
The number of functions built into WordPress is kind of incredible. Some of them get lost in the shuffle, one of those actions is
This action gives you the ability to add or adjust content or fields for a post or page when the submit/update box is clicked.
At this point you are probably asking ‘Why would I want to do this?’.