Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Aug 10, 1999

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.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap