How to use two arrays together

# Thread: How to use two arrays together

1. Senior Member
Join Date
Dec 1969
Posts
1,388

## How to use two arrays together

Ok, I have an array that is comprised of up to 500 ID numbers. On the site, next to each ID number, you can select how much of a product you want to deduct from that ID using radio buttons. How do I get the number in the radio button array to match the corresponding IDs in the ID array. <BR><BR>THanks,<BR>Matt

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## RE: How to use two arrays together

Make the name of each radio button dependent on the ID number.<BR><BR>Thus:<BR><BR>&#060;TD&#062;&#060;% = idnumbers(n) %&#062;&#060;/TD&#062;<BR>&#060;TD&#062;&#060;Input Type=Radio Name="Radio_&#060;% = idnumbers(n) %&#062;" Value=1&#062;1<BR>&#060;TD&#062;&#060;Input Type=Radio Name="Radio_&#060;% = idnumbers(n) %&#062;" Value=2&#062;2<BR>&#060;TD&#062;&#060;Input Type=Radio Name="Radio_&#060;% = idnumbers(n) %&#062;" Value=3&#062;3<BR>&#060;TD&#062;&#060;Input Type=Radio Name="Radio_&#060;% = idnumbers(n) %&#062;" Value=4&#062;4<BR><BR>Then, on the next page, you will do:<BR><BR>&#060;%<BR>For Each Item in Request.Form<BR>&nbsp; &nbsp; If Left(Item,6) = "Radio_" Then<BR>&nbsp; &nbsp; &nbsp; &nbsp; idnumber = CInt( Mid(Item,7) )<BR>...<BR>Next<BR>%&#062;<BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
1,388

## RE: How to use two arrays together

What do the Item, 6 and Item,7 mean?<BR><BR>Thanks a lot Bill,<BR>Matt

4. Senior Member
Join Date
Dec 1969
Posts
1,388

## RE: How to use two arrays together

What do the Item,6 and Item,7 mean?

5. DF Guest

## RE: How to use two arrays together

The Left(Item,6) means the 6 character at the left(Start) of the string. Mid(Item,7) Means every char from the 7th char to th end. Item is the item used in the for loop, in this case radio buttons.<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•