Hi there
Iâm currently working on quite a complicated project (i.e. itâs all new to me!!) and have a few coding issues that Iâll need to ask you lovely people out there for help on!
Iâm working on a âProduct Returnsâ section, so if people want to return items that are damaged/faulty etc, they can go online and enter in all the necessary information.
All the information stored on our system is passed through to my asp page as one long string, with a } separating each line of code, and a | separating each item on each line. This is all fine.
I then have 2 variables, counterx (the line number) and countery (the counter for each item) which allows me to put all the information neatly into a table
e.g. }Jane Bloggs|Necklace|20.00|1|0|}Jane Bloggs|Bracelet|15.00|1|0|}
gives me:
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>CUSTOMER NAME </td>
<td>PRODUCT DESCRIPTION </td>
<td>PRICE</td>
<td>SHIPPED</td>
<td>RETURN QTY </td>
</tr>
<tr>
<td> Jane Bloggs </td>
<td>Necklace</td>
<td>20.00</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td> Jane Bloggs </td>
<td>Bracelet</td>
<td>15.00</td>
<td>1</td>
<td>0</td>
</tr>
</table>
so on the first line, counterx=0 and on the second line, counterx=1 (and so on for the number of lines I have). And taking line 1, countery=0 would be Jane Bloggs, countery=1 would be Necklace and so on.
So, my first little problem I need to overcome is thisâ¦
Iâve managed to swap the Return Qty value thatâs currently shown as 0 with a text box for each line. This is because the user will need to enter in their own value.
So, in my code I have the following line
<% Response.write "<input name='rquan' type='text' id='rquan' value='0' size='3' tabindex='1'/>" %>
This writes out the text box fine BUT on every line, this text box is called the same name and I need it to be a unique name, so I thought Iâd add the value of counterx to the end of the name so that each one is unique, and corresponds to the correct line.
e.g. On line 1, where counterx=0 Iâd like the text box to be called rquan0. On line 2, where counterx=1 Iâd like the text box to be called rquan1 etc
I know I need to attach &counterx to the name, somehow BUT I canât seem to get this to work â any ideas how to solve my first problem (more questions to follow when I get stuck again!!)
Thanks in advance
Lucy