Hi,
I am trying to place the following in a javascript.
It works when it is not in a loop, but when it is in a loop it gets the last record instead of the one that it relates to in the loop, any ideas on how to get this to work in a loop environment?
Code:
thanks in advance to any one that can or will help.Code:<% For intRec=1 To rsMaterials.PageSize If Not rsMaterials.EOF Then %> <% Set rsCategoryDetails = Server.CreateObject("ADODB.Recordset") strCategoryDetails = "SELECT ID, title, order FROM materialsCategories WHERE ID = " & rsMaterials("category") & "" rsCategoryDetails.Open strCategoryDetails, adoCon Set rsSupplierDetails = Server.CreateObject("ADODB.Recordset") strSupplierDetails = "SELECT ID, active, company, phone, fax, email, addressPhysicalStreet, addressPhysicalSuburb, addressPhysicalPostalCode, addressPhysicalCity, addressPostalStreet, addressPostalSuburb, addressPostalPostalCode, addressPostalCity, createdBy, created, updatedby, updated FROM suppliers WHERE ID = " & rsMaterials("supplier") & "" rsSupplierDetails.Open strSupplierDetails, adoCon Set rsPerMeasurementDetails = Server.CreateObject("ADODB.Recordset") strPerMeasurementDetails = "SELECT ID, title, titleMultiples, order FROM materialsPerMeasurement WHERE ID = " & rsMaterials("pricePer") & "" rsPerMeasurementDetails.Open strPerMeasurementDetails, adoCon Set rsDeleteItem = Server.CreateObject("ADODB.Recordset") strDeleteItem = "SELECT ID, createdBy, created, category, materials, supplier, pricePer, price, markup, updated, updatedBy, active FROM materials WHERE ID = " & rsMaterials("ID") & "" rsDeleteItem.Open strDeleteItem, adoCon %> <div class="list-id"> <%=rsMaterials("ID")%> </div> <div class="list-category"> <%=rsCategoryDetails("title")%> </div> <div class="list-materials"> <%=rsMaterials("materials")%> </div> <div class="list-supplier"> <%=rsSupplierDetails("company")%> </div> <div class="list-price"> $<%=rsMaterials("price")%> <span class="grey-small">(<%=rsPerMeasurementDetails("title")%>)</span> </div> <div class="list-mark-up"> <%=rsMaterials("markUp")%>% </div> <div class="list-total-price"> $<%=formatNumber((((rsMaterials("price")/100)*rsMaterials("markUp"))+rsMaterials("price")),2)%> </div> <div class="list-edit"> <a href="materials.asp?itemEdit=<%=rsMaterials("ID")%>">Edit</a> | <a href="#" onclick="deleteItem()" style="cursor:auto">Delete</a> <script> function deleteItem() { var x; var r=confirm("Are you sure your wish to delete this item?"); if (r==true) { x=window.location = "materials.asp?delete=<%=rsDeleteItem("ID")%>"; } else { x=window.location = "materials.asp" } document.getElementById("demo").innerHTML=x; } </script> </div> <% rsMaterials.MoveNext End If next %>


(right side on this reply ) and agree

