put <showform> before your form. put </showform> <reply> </reply> <insertform /> after your form. Put your thankyou message HTML between the reply tags. Modify the form to include alerts as required.