Submit a form when page loads : Active Server Pages (ASP)

This v.short tutorial shows you how to submit a form when the page loads, so that the user does not have to click a button at all.


Basic knowledge of HTML/ASP Comfortable typing code into page.


Create your page.

Add a form, give it a name (fmform1)

Instead of adding the usual Textfields, menus etc place Hidden fields to capture all the data you which to include in your form. i.e value=”Yes”

If this is a simple form to second page, then give the form the destination page as normal, if it is an Insert or Update script then include your usual code.

Find the BODY tag for your page and add this code onLoad=”document.fmform1.submit()”

And there you have it, you form will run when the page loads, then move onto your destination page with hardly a pause, and the user will be none the wise.