K
kmdwebdesign
Hi,
I have a page in my admin system where the user can edit products they
have added. The problem I am having is with Related Products. These are
all listed in a multiple list. What I need to do is have those selected
when the product was added, already be highlighted in the multiple list
on the product edit page. Here is my post from another forum.
Appreciate if anyone could help.
Regards
SH
----
This is the recordset for the product they're editing
Dim rs_service
Dim rs_service_numRows
Set rs_service = Server.CreateObject("ADODB.Recordset")
rs_service.ActiveConnection = MM_covers_STRING
rs_service.Source = "SELECT * FROM tbl_services WHERE ID =
"+Request.QueryString("ID")+""
rs_service.CursorType = 0
rs_service.CursorLocation = 2
rs_service.LockType = 1
rs_service.Open()
rs_service_numRows = 0
This is the recordset to display ALL other products in the databse (so
they have ALL the products to select for a related product)
Dim rs_service2
Dim rs_service2_numRows
Set rs_service2 = Server.CreateObject("ADODB.Recordset")
rs_service2.ActiveConnection = MM_covers_STRING
rs_service2.Source = "SELECT * FROM tbl_services"
rs_service2.CursorType = 0
rs_service2.CursorLocation = 2
rs_service2.LockType = 1
rs_service2.Open()
rs_service2_numRows = 0
This is my session variable to receive the ID's of the related products
already entered
Dim rs_related__MMColParam
rs_related__MMColParam = rs_service.Fields.Item("related").Value
Here is my list as it is in simple format
<select name="related" size="3" multiple>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs_service2.EOF))
%>
<option
value="<%=(rs_service2.Fields.Item("ID").Value)%>"><%=(rs_service2.Fields.Item("name").Value)%></option>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_service2.MoveNext()
Wend
%>
</select>
So the above is currently just displaying ALL of the products. What I
need to do is highlight ("selected") automatically, those products that
ID appears in my session variable created earlier.
--
I have a page in my admin system where the user can edit products they
have added. The problem I am having is with Related Products. These are
all listed in a multiple list. What I need to do is have those selected
when the product was added, already be highlighted in the multiple list
on the product edit page. Here is my post from another forum.
Appreciate if anyone could help.
Regards
SH
----
This is the recordset for the product they're editing
Dim rs_service
Dim rs_service_numRows
Set rs_service = Server.CreateObject("ADODB.Recordset")
rs_service.ActiveConnection = MM_covers_STRING
rs_service.Source = "SELECT * FROM tbl_services WHERE ID =
"+Request.QueryString("ID")+""
rs_service.CursorType = 0
rs_service.CursorLocation = 2
rs_service.LockType = 1
rs_service.Open()
rs_service_numRows = 0
This is the recordset to display ALL other products in the databse (so
they have ALL the products to select for a related product)
Dim rs_service2
Dim rs_service2_numRows
Set rs_service2 = Server.CreateObject("ADODB.Recordset")
rs_service2.ActiveConnection = MM_covers_STRING
rs_service2.Source = "SELECT * FROM tbl_services"
rs_service2.CursorType = 0
rs_service2.CursorLocation = 2
rs_service2.LockType = 1
rs_service2.Open()
rs_service2_numRows = 0
This is my session variable to receive the ID's of the related products
already entered
Dim rs_related__MMColParam
rs_related__MMColParam = rs_service.Fields.Item("related").Value
Here is my list as it is in simple format
<select name="related" size="3" multiple>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs_service2.EOF))
%>
<option
value="<%=(rs_service2.Fields.Item("ID").Value)%>"><%=(rs_service2.Fields.Item("name").Value)%></option>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_service2.MoveNext()
Wend
%>
</select>
So the above is currently just displaying ALL of the products. What I
need to do is highlight ("selected") automatically, those products that
ID appears in my session variable created earlier.
--