Unless there is a very good reason to do this -- don't. Instead, try to prevent duplicate submissions on the server side.
Anyway -- in broad strokes (I don't have time right now to code it myself) but :
2. In this function, get the id (or name) of the form tag (document.getElementById('myform'))
3. Loop through this object, get each element, set its disabled attribute to true.
4. Finally, trigger the submit() method of the form (document.getElementById('myform').submit())
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise