473,949 Members | 40,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request.Queryst ring Advice

1 New Member
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("A TID")

Set filesys = CreateObject("S cripting.FileSy stemObject")
set resultfile = filesys.CreateT extFile("D:\res ults\"& FiName & ".txt")
For each inputField In Request.QuerySt ring
For Each inputValue in Request.QuerySt ring(inputField )
resultfile .Writeline inputField & " = " & inputValue &"<BR>"
Next
Next
%>
Mar 25 '07 #1
1 1683
jhardman
3,406 Recognized Expert Specialist
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"><in put 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
17788
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?? Thanks, John
4
2760
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 to my system, the current admin user logged in gets logged out. I can't seem to work out how - I can't even trace back where some of the variables are coming from (for example, the "ref" part of the Request.QueryString method). Could someone...
5
2434
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
13281
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 Request.QueryString.Set("id", "0"); it says it is Read Only. How can this be done? Why is there a Set() method if you can't use it?
2
1849
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 the dat I use this code in as <%For Each strPartNo In Request.QueryString("pn" lngQty = Request.QueryString("qty_" & strPartNo strPartNo = LCase(strPartNo Response.Write("strPartNo"& strPartNo& lngQty Next %
4
25376
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 what I did in trational asp, however if I did abov in ASP.NET, I always got an error of "Object reference not set to an instance of an object. " How should I solve the problem?
1
3496
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
14273
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 works once; there after the old query gets re-written to the TextBox regardless of what is entered. I think this is because I'm using the Page_Load event which may being fired, replacing the new query with the one in the current URL, between time I...
2
5533
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 that in if I do this: var state = <%=Request.QueryString%> This returns an undefined object that I can't seem to do any checks
0
10171
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
11363
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10701
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9903
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8265
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6130
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4957
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4547
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.