M
MikeR
I have an order form that is builds a table from a database. It displays a
product, an input box for quantity ordered and an option box(finish). The options
are the same for each line built, and are hard-coded.
Product Quantity Finish
1" nails | | Plain
Brass
Galvanized
2" nails | | Plain
Brass
Galvanized
3" nails | | Plain
Brass
Galvanized
When the form is submitted, product and quantity ordered come to the asp action
page as (in this example) a 3 element array of request.form, but the options are
an array, whose number of elements is the number of them selected.
For instance if the user orders 20 1" nails Plain and 50 3" nails Brass
it looks like this on the action page:
request.form("Product")(1)="1_nails"
request.form("Product")(2)=""
request.form("Product")(3)="3_nails"
request.form("Quantity")(1)="20"
request.form("Quantity")(2)=""
request.form("Quantity")(3)="50"
request.form("Finish")(1)="Plain"
request.form("Finish")(2)="Brass"
On the action page, I loop request.form("Quantity").count times looking for a
quantity not equal to "" to build the SQL to update a database, but there are only
2 finish items, so the index for the third item is not 3 but 2.
How can I sync this?
Thanks,
MikeR
product, an input box for quantity ordered and an option box(finish). The options
are the same for each line built, and are hard-coded.
Product Quantity Finish
1" nails | | Plain
Brass
Galvanized
2" nails | | Plain
Brass
Galvanized
3" nails | | Plain
Brass
Galvanized
When the form is submitted, product and quantity ordered come to the asp action
page as (in this example) a 3 element array of request.form, but the options are
an array, whose number of elements is the number of them selected.
For instance if the user orders 20 1" nails Plain and 50 3" nails Brass
it looks like this on the action page:
request.form("Product")(1)="1_nails"
request.form("Product")(2)=""
request.form("Product")(3)="3_nails"
request.form("Quantity")(1)="20"
request.form("Quantity")(2)=""
request.form("Quantity")(3)="50"
request.form("Finish")(1)="Plain"
request.form("Finish")(2)="Brass"
On the action page, I loop request.form("Quantity").count times looking for a
quantity not equal to "" to build the SQL to update a database, but there are only
2 finish items, so the index for the third item is not 3 but 2.
How can I sync this?
Thanks,
MikeR