469,360 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

submit the form to the server without opening another page

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!!
Jul 19 '05 #1
8 2837
myform.submit() is just the scripting way to submit the form instead of
waiting for the user to click submit. It'll still do the same thing. You
can always response.redirect back to page1.asp after page2.asp does it's
thing.

Ray at home

"Matt" <ma*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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!!

Jul 19 '05 #2
so basically myform.submit(); will just submit the form to the server, and
doesn't load any page. What I want is to submit the form data and don't open
another page. That's why <form action="page2.asp" method="post"> may not
work for me.

please advise. thanks!!

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:##**************@tk2msftngp13.phx.gbl...
myform.submit() is just the scripting way to submit the form instead of
waiting for the user to click submit. It'll still do the same thing. You
can always response.redirect back to page1.asp after page2.asp does it's
thing.

Ray at home

"Matt" <ma*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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!!


Jul 19 '05 #3
Why don't you want to submit the form?
Surely your user wants to knw whether their form has been submitted or not.
What are you trying to do, perhaps someone has done something similar
before.

Regards
Stu
Jul 19 '05 #4
What do you mean but "don't want to open another page" ?

Data are always posted to a page. Usually they are posted to the page that
is currently displayed and the page redisplays itself (but had the time to
update the info in the database or to process these inputs server side).

If the page doesn't sent any HTML output (iincludes clearing headers), I
believe the display will not change (but generally it's probably better to
have visually a change even such a glimpse so that the user knows it's input
is processsed).

Patrice
"Matt" <ma*******@hotmail.com> a écrit dans le message de
news:eH**************@tk2msftngp13.phx.gbl...
so basically myform.submit(); will just submit the form to the server, and
doesn't load any page. What I want is to submit the form data and don't open another page. That's why <form action="page2.asp" method="post"> may not
work for me.

please advise. thanks!!

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:##**************@tk2msftngp13.phx.gbl...
myform.submit() is just the scripting way to submit the form instead of
waiting for the user to click submit. It'll still do the same thing. You can always response.redirect back to page1.asp after page2.asp does it's
thing.

Ray at home

"Matt" <ma*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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!!



Jul 19 '05 #5
Matt wrote:
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();


No. myform.submit() does the same thing that clicking te submit button does.

You will need to use XMLHTTP to do this. A google search should provide the
details.

Since using XMLHTTP involves client-side code. it is off-topic for this
group. If you need further help with it, try one of the .scripting groups.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #6

"Matt" <ma*******@hotmail.com> wrote in message
news:eH**************@tk2msftngp13.phx.gbl...
so basically myform.submit(); will just submit the form to the server, and
doesn't load any page.
No, myform.submit() will do the same thing that would happen if you (the
user) clicked the submit button.
What I want is to submit the form data and don't open
another page. That's why <form action="page2.asp" method="post"> may not
work for me.


What do you want to see when you submit?

Ray at work
Jul 19 '05 #7
Once I click submit button, I want to go to page2.asp in a new window.

That means I should do:
<form action="page2.asp" method="post" target="_blank">

Correct?

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:OM**************@TK2MSFTNGP12.phx.gbl...

"Matt" <ma*******@hotmail.com> wrote in message
news:eH**************@tk2msftngp13.phx.gbl...
so basically myform.submit(); will just submit the form to the server, and doesn't load any page.


No, myform.submit() will do the same thing that would happen if you (the
user) clicked the submit button.
What I want is to submit the form data and don't open
another page. That's why <form action="page2.asp" method="post"> may not
work for me.


What do you want to see when you submit?

Ray at work

Jul 19 '05 #8
That should work. :]

Ray at home

"Matt" <ma*******@hotmail.com> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl...
Once I click submit button, I want to go to page2.asp in a new window.

That means I should do:
<form action="page2.asp" method="post" target="_blank">

Correct?

Jul 19 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mark Michel | last post: by
3 posts views Thread by Matt | last post: by
2 posts views Thread by Terence Parker | last post: by
4 posts views Thread by Bob Lehmann | last post: by
6 posts views Thread by CJM | last post: by
3 posts views Thread by frenchy | last post: by
17 posts views Thread by Johnny BeGood | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.