473,394 Members | 1,828 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.

Request.Querystring Advice

Hi All,

I am new to programming so apologies if this is a basic question. I am using the following code to request the form field values. however all works as expected but the field order is mixed up.

I have tried setting the tabindex on the fields,to try and resolve the issue, but no such luck.

Is there any way i can sort the field order using the tabindex ?

Thanks in advance.

************************************************** ******************

<%

FiName = Request.Form("ATID")

Set filesys = CreateObject("Scripting.FileSystemObject")
set resultfile = filesys.CreateTextFile("D:\results\"& FiName & ".txt")
For each inputField In Request.QueryString
For Each inputValue in Request.QueryString(inputField)
resultfile .Writeline inputField & " = " & inputValue &"<BR>"
Next
Next
%>
Mar 25 '07 #1
1 1658
jhardman
3,406 Expert 2GB
No, the request.query string order is a mystery. I've heard it discussed before and the general consensus is that it is not predictable. I've handled the problem like this, I named all of the fields numerically:
<input name="inp1"><input name="inp2"> etc. Then When I pulled it up I said:
Expand|Select|Wrap|Line Numbers
  1. dim i
  2. for i = 1 to 500 'some insanely high number
  3.    if request("inp" & i) <> "" then
  4.       response.write request("inp" & i) & "<br>" & vbNewLine
  5.    end if
  6. next
  7.  
you could also put the names of the inputs in a numbered array like this
Expand|Select|Wrap|Line Numbers
  1. dim inputs(500)
  2. inputs(1) = "userName"
  3. inputs(2) = "favExoticAnimal"
  4. inputs(3) = "hairStyle"
  5. dim i
  6. for i = 1 to 500
  7.    if request(inputs(i)) <> "" then
  8.       response.write request(inputs(i)) & "<br>" & vbNewLine
  9.    end if
  10. next
Sorry I couldn't be more help.

Jared
Mar 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Davis | last post by:
I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the same, which is to return the value of the field?? ...
4
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered...
5
by: Ivan | last post by:
hi, I saw some program using "request("fieldname") " instead of "request.QueryString" to get the value from URL, what's the different ?? thanks
4
by: Steve | last post by:
Hi- I'd like to set values in the QueryString if I detect that a user submits a bad value, say... ?id=333 where there is no id '333', I would like to set it to '0' for example. I tried to use...
2
by: mahsa | last post by:
Hi have have some link like thi http://x.com/Shoppingcart.aspx?pn=ps50210&qty_ps50210=1&pn=excel&qty_excel=1&pn=l4504000&qty_l4504000=1&sku=PS50210&cat=laminate&action=updat now I want to request...
4
by: Guoqi Zheng | last post by:
On my application, I need to have different action based on the pass in query string. When the query string is not presented, I try to use If request.querystring("id") ="" THEN ...... This is...
1
by: C | last post by:
Hi, I have been using VB.Net for the past 2 years and have moved to C# I send a value in the URL to a page. In my called page I do below. int intTest = int.Parse(Request.QueryString);
0
by: ricklafleur | last post by:
I'm using CSharp/ASP.NET 2.0 and trying to create a simple search page that records the user query in the URL (so can be bookmark) and also re-writes the query int the original TextBox. This only...
2
by: Doogie | last post by:
Hi, I'm writing Javascript code to parse out a query string. I want to handle the case where a parameter value may not be sent. So consider a parameter called "State". If the user doesn't pass...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.