either of those 2 will work, they are just reiterations of the same concept in my initial link.
it's just a mater of adding the onclick event code to the submit button, and the javascript function in the head of your page.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.