I'm in the middle of developing a classic asp website and we have a cart function which displays whats currently in the users cart, this workd well it displays however many products they have in there cart using a repeat region.
We have an option where the user can update the qty per item, this only works on the first item in the recordset and no matter what button you press i.e whichever line the qty is updated on the first product only.
See code below, any suggestion would be appreciated:
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<form action="<%=MM_editAction%>" METHOD="POST" name="form1">
<tr>
<td class="image">
<a href="shop.asp?sku=<%=Recordset1.Fields("sku")%>&sessionx=<%=Recordset1.Fields("sessionx")%>"> <img class="img-fluid" src="<%=(Recordset1.Fields.Item("image").Value)%>" alt=""/></a>
</td>
<td class="description">
<a href="shop.asp?sku=<%=Recordset1.Fields("sku")%>&sessionx=<%=Recordset1.Fields("sessionx")%>"><%=(Recordset1.Fields.Item("name").Value)%></a>
</td>
<td class="price">£<%=(Recordset1.Fields.Item("totalprice").Value)%></td>
<td class="td-quentety">
<input type="number" value="<%=(Recordset1.Fields.Item("qty").Value)%>" name="qty">
</td>
<td class=""><a class="button mt-10" href="#" onclick="document.forms['form1'].submit(); return false;">Update</a>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("idx").Value %>">
</form>
</td>
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="form2">
<td class=""><a class="button mt-10" href="#" onclick="document.forms['form2'].submit(); return false;">Remove</a></td>
</tr>
<input type="hidden" name="MM_delete" value="form2">
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("idx").Value %>">
</form>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>