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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to submit form data without leaving the page

Status
Not open for further replies.

camillaj

Programmer
Sep 18, 2003
31
AU
I am simply trying to submit my form data to another page, but I don't want to leave the page.

I am simply doing a
document.forms["form1"].action = "anotherpage.asp"
document.forms["form1"].submit();

This takes me to anotherpage.asp. I want to do some processing in that page, but the user should not leave the current page.

Any help please :)

thanks
 
I usually do this;

insert a hidden value in the form

<input type=&quot;hidden&quot; name=&quot;task&quot; value=&quot;doit&quot;>

Then, after the </form> tag

<% Dim task
task = Request(&quot;task&quot;)

IF TASK = &quot;doit&quot; THEN

strSQL = &quot;insert into table (field1, field2, etc) values ('get your form values)

conn.execute strSQL

Response.write &quot;<P>Data has been submitted<BR>&quot;


End IF
%>

This will insert data without leaving the page.


Bye


Qatqat
Reqponse .wri

Life is what happens when you are making other plans.
 
I usually do this;
Set the form action to the current page.
insert a hidden value in the form

<input type=&quot;hidden&quot; name=&quot;task&quot; value=&quot;doit&quot;>

Then, after the </form> tag

<% Dim task
task = Request(&quot;task&quot;)

IF TASK = &quot;doit&quot; THEN

strSQL = &quot;insert into table (field1, field2, etc) values ('get your form values)

conn.execute strSQL

Response.write &quot;<P>Data has been submitted<BR>&quot;


End IF
%>

This will insert data without leaving the page.


Bye


Qatqat
Reqponse .wri

Life is what happens when you are making other plans.
 
submit the form to the page itself and use commands(update,insert... and request. XXXX -XXX=form,session,variable,whatever....
All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top