| Author |
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!!
| |
| Ray at 2004-05-30, 11:53 am |
| 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" <mattloude@hotmail.com> wrote in message
news:%2325Woz4QEHA.3616@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!!
>
>
| |
|
| 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:##phDe5QEHA.3016@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" <mattloude@hotmail.com> wrote in message
> news:%2325Woz4QEHA.3616@TK2MSFTNGP11.phx.gbl...
> data.
>
>
| |
| Stuart Palmer 2004-05-30, 11:53 am |
| 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
| |
| Patrice 2004-05-30, 11:53 am |
| 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" <mattloude@hotmail.com> a écrit dans le message de
news:eHlkI45QEHA.3596@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:##phDe5QEHA.3016@tk2msftngp13.phx.gbl...
You[vbcol=seagreen]
>
>
| |
| Bob Barrows [MVP] 2004-05-30, 11:53 am |
| 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"
| |
| Ray at 2004-05-30, 11:54 am |
|
"Matt" <mattloude@hotmail.com> wrote in message
news:eHlkI45QEHA.3596@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
| |
|
| 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:OMe2Bi$QEHA.2824@TK2MSFTNGP12.phx.gbl...
>
> "Matt" <mattloude@hotmail.com> wrote in message
> news:eHlkI45QEHA.3596@tk2msftngp13.phx.gbl...
and[vbcol=seagreen]
>
> No, myform.submit() will do the same thing that would happen if you (the
> user) clicked the submit button.
>
>
> What do you want to see when you submit?
>
> Ray at work
>
>
| |
| Ray at 2004-05-30, 11:54 am |
| That should work. :]
Ray at home
"Matt" <mattloude@hotmail.com> wrote in message
news:O3m4bbcREHA.1160@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?
|
|
|
|