Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

varying number of form fields posted for process 1

Status
Not open for further replies.

cr84net

Technical User
Jan 16, 2003
2
I have a 3 field form that is multiplied by the number of items a person orders. If someone orders 3 items, 9 fields are displayed, if they order 4 then 12 fields are displayed etc.I am using a loop to create the fields and the code is like this (qty is an integer):
Code:
<input type=hidden name="sku"  value="<%=sku%>" >
<input type=hidden name="qty"  value="<%=qty%>" >
<input type=hidden name="ordernum"  value="<%=eon%>" >

t= qty

z=1


Do While z<= t

<input type=text name="T<%=z%>Line1" size="30" >

<input type=text name="T<%=z%>Line2" size="30" >

<input type=text name="T<%=z%>Line3" size="30" >

z=z + 1

   Loop

I have simplified the code for ease of discussion. My problem is I can't seem to get my head around how to properly process the input fields. Once posted, I would like to end up with the three fields that go together in a string like:

T1Line1 & T1Line2 & T1Line3
T2Line1 & T2Line2 & T2Line3
T3Line1 & T3Line2 & T3Line3

A line separator would be nice like:

T1Line1 & ~ & T1Line2 & ~ & T1Line3

Each string will be submitted to an access db along with the sku and ordernum . The line separator would be available so I can separate the lines when I retrieve them from the db.

Any ideas ?

Thank you, any help would be appreciated.
 
Any ideas ?

Yes. My first idea is that you may need to think a little bit more about your database design. No offense, but that seems a bit strange.

Can you tell us why you want to store a line separator and mash three fields together in the database? Do you have something else you are doing with the data?

I think I might consider storing 3 fields in a table.
Tbl:eek:rders
order_num pk
sku
qty

I might have a table with an customer_num as well.
Tbl:current_business
order_num
customer_num



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top