You can do this with jQuery:
Add jquery to your website
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
Add the code below inside the <script>
tags or external js file. The text between quotation marks is a selector for the submit button.
$(document).ready(function(){ $('#submit-btn-id').click(function(){ $(this).hide(); $('.loadingImg').show(); }); });
source share