devxlogo

Submitting a Form Without a Submit Button

Submitting a Form Without a Submit Button

Question:

How can I submit a form in ASP without a user clicking on a button? I tried:

nameofform.submit()

but I get the error:

Microsoft VBScript runtime error '800a01a8' Object required: ''

Answer:

Your code is correct, however, it needs to be run as Client side JavaScript code, not Server Side VB Script code. You will still need to figure out an event when the form will be submitted (even though it does not have a submit button). This event could be the loading of the page, the filling of a text box, the clicking of a check box, or so on. In the code for any of these events, call your function that in turn calls the .submit method of the form.

For example, if your form name is called ‘info’, then you could place code in the Window Onload event as follows:

Now when the page finishes loading, it kicks off the submit of the form also.

See also  How to Avoid Money Transfer Scams  
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist