submit the form to the server without opening another page

M

Matt

I want to submit the form to the server without opening another page.

When we do the following, it will submit the form data in myform to
the IIS, and open page2.asp.

<form name="myform" action="page2.asp" method="post">

But I don't want to open another page, I just want to submit the form data.
Should I do the following??
myform.submit();


Please advise. Thanks!!
 
M

Mark Parnell

I want to submit the form to the server without opening another page.

Have the page with the form on it do the processing as well.

<% if Request.Form("submit") = "submit" then ...

'form handling stuff here

else %>

<form action="formpage.asp" ... >
 
T

Toby A Inkster

Matt said:
<form name="myform" action="page2.asp" method="post">

But I don't want to open another page, I just want to submit the form data.
Should I do the following??

page2.asp should process the data and then return a HTTP status code of
204. This will result in the browser staying on the current page.

You should ask yourself if this is wise though -- end users may be a
little confused if they don't advance to a new page that acknowledges
their submission. They may end up trying to submit the information again
several times.

HTTP code 205 may also be an option. The difference between them can be
seen here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
 
J

Jay

Toby A Inkster said:
page2.asp should process the data and then return a HTTP status code of
204. This will result in the browser staying on the current page.

You should ask yourself if this is wise though -- end users may be a
little confused if they don't advance to a new page that acknowledges
their submission. They may end up trying to submit the information again
several times.

HTTP code 205 may also be an option. The difference between them can be
seen here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

A string could be declaired to print to the screen confirming that the form
submission was successful.


--
"Some see the glass as half-empty;
some see the glass as half-full.
I see the glass as too big." - George Carlin

- J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top