Submitting Form WITHOUT Submit Button 
Author Message
 Submitting Form WITHOUT Submit Button

Hello Everyone,
I am trying to incude code in my ASP that will automatically submit a form's
contents to another Active Server Page, as I do not want to depend on the
user to hit the "submit" button.  I know this can be done, but I can't seem
to figure out how to do it. I would appreciate any help you can provide me,
as I am working under a deadline and am very frustrated! Thanks in advance.
Kathleen



Sun, 24 Feb 2002 03:00:00 GMT  
 Submitting Form WITHOUT Submit Button

Quote:
>Hello Everyone,
>I am trying to incude code in my ASP that will automatically submit a
form's
>contents to another Active Server Page, as I do not want to depend on the
>user to hit the "submit" button.

Try OnUnLoad of BODY. Use a JavaScript function like
OnUnLoad='document.myform.submit()'.
Erich


Tue, 26 Feb 2002 03:00:00 GMT  
 Submitting Form WITHOUT Submit Button
Hi Erich,
Thanks for the suggestion.  It did not work entirely, so I am hoping that
you might be able to share some more ideas.
Here's what I am trying to do:
I have a form into which users type the type of report that they want to run
and the dates that it should cover.  When the user hits the submit button on
this form, a SQL stored procedure executes and populates a form on a second
asp page.  I do not want this second asp page to ever be visible for the
user.  I have this page because the stored procedure does not return its
results in a manner that is conducive to the report format that the user
ultimately wants to see.  So, ideally, I want this second asp page to submit
its form results to a third asp page which will then lay out the report as
needed.  Thus, I want the stored procedure to execute, the form to populate
and for the form to then be submitted to the the third page.
When I tried the body onunload approach, I found that the report lacked
complete information because the form results were submitted prior to the
form being populated in its entirety.  (I know that the stored procedure is
capable of populating the form in its entirety because if I use a submit
button on the second page, the third page does receive all of the data
needed for the report.)
Do you have any other ideas?  Is there any way for me to delay the
submission of the form by a few seconds?
Thanks for any help you can provide!
Kathleen
Quote:

>>Hello Everyone,
>>I am trying to incude code in my ASP that will automatically submit a
>form's
>>contents to another Active Server Page, as I do not want to depend on the
>>user to hit the "submit" button.

>Try OnUnLoad of BODY. Use a JavaScript function like
>OnUnLoad='document.myform.submit()'.
>Erich



Tue, 26 Feb 2002 03:00:00 GMT  
 Submitting Form WITHOUT Submit Button
Actually there is at least two ways to accomplish what you are trying:
You can outout the results of the stored procedure to a session variable,
then redirect to the actual report processing ASP page.  that page will then
read the session variable instead of form POST fields.

to continue doing it the way you have already designed;

Add the following code (sub your form name etc) inside you <head></head>
element
<SCRIPT LANGUAGE=javascript>
<!--

function window_onload()
{
 frmName.submit()

Quote:
}

-->
</SCRIPT>

Change your <body. tag to the following

<BODY LANGUAGE=javascript onload="return window_onload()">


Quote:
> Hi Erich,
> Thanks for the suggestion.  It did not work entirely, so I am hoping that
> you might be able to share some more ideas.
> Here's what I am trying to do:
> I have a form into which users type the type of report that they want to
run
> and the dates that it should cover.  When the user hits the submit button
on
> this form, a SQL stored procedure executes and populates a form on a
second
> asp page.  I do not want this second asp page to ever be visible for the
> user.  I have this page because the stored procedure does not return its
> results in a manner that is conducive to the report format that the user
> ultimately wants to see.  So, ideally, I want this second asp page to
submit
> its form results to a third asp page which will then lay out the report as
> needed.  Thus, I want the stored procedure to execute, the form to
populate
> and for the form to then be submitted to the the third page.
> When I tried the body onunload approach, I found that the report lacked
> complete information because the form results were submitted prior to the
> form being populated in its entirety.  (I know that the stored procedure
is
> capable of populating the form in its entirety because if I use a submit
> button on the second page, the third page does receive all of the data
> needed for the report.)
> Do you have any other ideas?  Is there any way for me to delay the
> submission of the form by a few seconds?
> Thanks for any help you can provide!
> Kathleen


> >>Hello Everyone,
> >>I am trying to incude code in my ASP that will automatically submit a
> >form's
> >>contents to another Active Server Page, as I do not want to depend on
the
> >>user to hit the "submit" button.

> >Try OnUnLoad of BODY. Use a JavaScript function like
> >OnUnLoad='document.myform.submit()'.
> >Erich



Thu, 28 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Submitting form without submit button...

2. Submitting form without submit button...

3. What fires the submit action of a form without a submit button

4. Submitting Form WITHOUT a Submit Button

5. submit without submit button

6. SUBMIT form with 3 different submit buttons - error

7. form submits hrefs images and submit buttons

8. form submit using different submit buttons

9. SUBMIT form with 3 different submit buttons - error

10. Form entry without the use of the submit button

11. VBScript Newbie : Form Entry using a combo box without submit button

12. submit button to operate another submit button

 

 
Powered by phpBB® Forum Software