473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

pass data by query string using submit button

In ASP, when we pass data between pages, we usually pass by query string. If
we pass data by query string, that means we need to use submit button, not
by regular button, and the form will pass to the server since it's GET or
POST request. But if just form-to-form communication, why we need to send
the form to the server? Please help clarify. Thanks!!

<form action="process.asp" method="get">
//form controls

<input type="submit">
</form>

For example, http://www.myserver.com?id=100&name=joe

Form.QueryString("id")
Form.QueryString("name")

Jul 19 '05 #1
7 23612
Hi!

First of all you should consider posting most of you data because the
querystring is limited in size.

You can use a standard button if you also allow for example javascript. Just
submit or do what you want in the onclick event.

Not sure I understand the form to form communication. If you have two (or
more forms) in the same html output from your asp page you can use
javascript to set values from one form to another (no need to roundtrip to
server). You cannot access a form that is not loaded to the browser without
a roundtrip to the server. If you view source of you html code and can find
your <form> tag then you can access them without roundtrip.

Regards
/Hans
Jul 19 '05 #2
The browser has to go to the server to get the next page anyway, doesn't it?
If you're talking about form-to-form within one page, you don't have to do
anything with the server.

Ray at home

"Matt" <ma*******@hotmail.com> wrote in message
news:uh**************@TK2MSFTNGP10.phx.gbl...
In ASP, when we pass data between pages, we usually pass by query string. If we pass data by query string, that means we need to use submit button, not
by regular button, and the form will pass to the server since it's GET or
POST request. But if just form-to-form communication, why we need to send
the form to the server? Please help clarify. Thanks!!

<form action="process.asp" method="get">
//form controls

<input type="submit">
</form>

For example, http://www.myserver.com?id=100&name=joe

Form.QueryString("id")
Form.QueryString("name")

Jul 19 '05 #3

Hi

You can use javascript code as follows to transfer values between form
form2.field1.value = form1.field1.value

Cheer

Pravi

----- Matt wrote: ----

In ASP, when we pass data between pages, we usually pass by query string. I
we pass data by query string, that means we need to use submit button, no
by regular button, and the form will pass to the server since it's GET o
POST request. But if just form-to-form communication, why we need to sen
the form to the server? Please help clarify. Thanks!

<form action="process.asp" method="get"
//form control

<input type="submit"></form

For example, http://www.myserver.com?id=100&name=jo

Form.QueryString("id"
Form.QueryString("name"


Jul 19 '05 #4
Ray

The following code means page1.asp will submit the form to server, and then get page2.asp from the server. Right
//page1.as
<form action="page2.asp" method="get"
//form control

<input type="submit"></form

On the other hand, the following code also gets page2.asp from the server, but it won't submit the form of page1.asp to the server. Correct

//page1.as
<script type="text/javascript"
function openWindow(
{ window.open("page2.asp", ...)

</script><input type="button" onClick="openWindow()"

so the rule of thumb is "submit" will send the form data to the server (either by GET or POST protocol), but "button" won't do this. The conclusion is if I have page1.asp, and page2.asp, and wants page2.asp gets the form data of page1.asp, then we need to use "submit" in page1.asp. Correct?

I really need to clarify this. Please advise. Thanks!!
Jul 19 '05 #5
What you said is generally correct. It is possible, however, to build a
querystring using client-side code and still sending the values in your
window.open() though. openWindow('page2.asp?x='+document.form.x.value)

If you want/need to do something like and are unsure how to do it, venture
into a jscript scripting group such as microsoft.public.scripting.jscript.
I believe there are some better Javascript groups that are non-MS hosted
though.

Ray at home


"Matt" <an*******@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Ray,

The following code means page1.asp will submit the form to server, and then get page2.asp from the server. Right? //page1.asp
<form action="page2.asp" method="get">
//form controls

<input type="submit"></form>

On the other hand, the following code also gets page2.asp from the server, but it won't submit the form of page1.asp to the server. Correct?
//page1.asp
<script type="text/javascript">
function openWindow()
{ window.open("page2.asp", ...);
}
</script><input type="button" onClick="openWindow()">

so the rule of thumb is "submit" will send the form data to the server (either by GET or POST protocol), but "button" won't do this. The conclusion
is if I have page1.asp, and page2.asp, and wants page2.asp gets the form
data of page1.asp, then we need to use "submit" in page1.asp. Correct??
I really need to clarify this. Please advise. Thanks!!

Jul 19 '05 #6
Thanks Ray

When we say submit, and reset the form to the server, or post the form, it means send the form control data to the server (IIS) and store those data for further processing (For example, other page needs that data). But IIS is a server, not a database. How can IIS store those data?

Please advise!!
Jul 19 '05 #7
http://www.aspfaq.com/5007
The page that processes the form when it is submitted can retreive the
values from the request.querystring collection when using method=get or the
request.form collection when using method=post.
http://www.aspfaq.com/5007

<form method=post action=posttome.asp>
<input type="text" name="TheTextBox">
<input type="submit">
</form>
http://www.aspfaq.com/5007
posttome.asp:
<%
Response.Write "The value you entered is " & Request.Form("TheTextBox")
%>
http://www.aspfaq.com/5007
<form method=get action=getme.asp>
<input type="text" name="TheTextBox">
<input type="submit">
</form>
http://www.aspfaq.com/5007
getme.asp:
<%
Response.Write "The value you entered is " &
Request.Qyerystring("TheTextBox")
%>
http://www.aspfaq.com/5007

Ray at home

"Matt" <an*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Thanks Ray.

When we say submit, and reset the form to the server, or post the form, it means send the form control data to the server (IIS) and store those data
for further processing (For example, other page needs that data). But IIS is
a server, not a database. How can IIS store those data?
Please advise!!

Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
How to pass data back and forth between ASP and JSP page? Let's say I have Java objects, how to pass the data back to ASP page?? Or ASP has data, how to pass the data to JSP page?? Please...
1
by: Terry | last post by:
hi, could any1 help me with this? There're one button and one textbox on Page A. click the button: <Code Behind > Dim ClientScript As String = ""
3
by: Nath | last post by:
Please help!? I am new to writing html, javascript, pretty new to MySQL but quite proficient at writing Perl and i'm a quick learner. I am building a database driven website and i am a little...
3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
3
by: Dthmtlgod | last post by:
I want to pass the value to two frames and two pages after hitting the submit button If my form I have this <form method="get" action="search2.asp" target="fSearch2"> I want to pass crPN to...
5
by: Steve JORDI | last post by:
Hi, I have a strange behavior when using IExplorer over FireFox. There is an html form that asks for the name of a city and has a dedicated field for that with a submit button next to it. In...
11
by: kabradley | last post by:
Hello Everyone, So, thanks to nico's help I was finally able to 'finish' our companies access database. For the past week or so though,I have been designing forms that contain a subform and an...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.