Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit the page to itself based on a condition

Status
Not open for further replies.

ravula2000

IS-IT--Management
Mar 8, 2002
205
US
I want to submit the page to itself based on a condition. How can I do that in ASP?
Please help..

Iam using this..
Response.Write &quot;<script language='javascript'>&quot;
Response.write &quot;document.form1.action = 'a.asp?save=Y';&quot;
Response.Write &quot;document.CheckForm.submit();&quot;
Response.Write &quot;</script>&quot;
It is not working.. What is the problem with this?

Thanks
 
...And what is a name of your form - form1 or CheckForm?
 
Actually at a particular point after the validations I want to submit the form again to the same page. I cant call from body load. Can I write a javascript function and can I call from ASP like in Response.write &quot;postagin();&quot;

Thanks
 
When you use Response.write &quot;postagin();&quot;, it does not mean that you call javascript function posttagin() from ASP. It just means that you insert some portion of code into the result page. This code will be executed later on client site (in client browser)

Browser constructs each page dynamically while page is loaded. You cannot submit the form from page header, until the page body is loaded. When page is loaded the onload event occurs. So, if you want to submit form just after page is loaded, the good point is a body onload function.

It is possible to submit form again latter. However only if you use the target for form other than the current window.

Regards,
Sergey Smirnov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top