Forum Moderators: open

Message Too Old, No Replies

Changing the order of the fields retreived from a form

Is this possible?

         

timchuma

1:24 am on Jun 22, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



For an auto-generated form I have the following order of fields:
savevalues
userid
productcode
PrintColour1_1 Colour1_1 Quantity_1
" " " "
" " " "
PrintColour1_5 Colour1_5 Quantity_5


I was hoping to get them from the request object by rows, but they come
out as the following (example values included):
savevalues = yes
userid = 4029
productcode = 46BN
PrintColour1_1 = Black
PrintColour1_2 =
PrintColour1_3 =
PrintColour1_4 =
PrintColour1_5 =
Colour1_1 = Red
Colour1_2 =
Colour1_3 =
Colour1_4 =
Colour1_5 =
Quantity_1 = 5
Quantity_2 =
Quantity_3 =
Quantity_4 =
Quantity_5 =

Is there any way of changing this order as I think it may make it easier to process the fields (which can change according to what the original
form fields are.)

Thanks.

txbakers

1:44 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can program the receiving script to display the form fields in any order you want.

The "Request" object contains an array of the items in the form, with their values, so you just reference the item by name:

Request("field1")
Request("field7")
Request("field22")

etc.