tell you what it's for someone in here. but once it's cracked I can use the experience for further projects.
I've amended his coding to this:
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Server.ScriptTimeout = 150
Dim Connection
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open "asp_test"
Dim Personal_Options
Set Personal_Options = Server.CreateObject("ADODB.Recordset")
Personal_Options.Open "SELECT * FROM Personalization WHERE SubscriberID = '1'", Connection, 2, 2
Dim TenderSubCategory
Set TenderSubCategory = Server.CreateObject("ADODB.Recordset")
TenderSubCategory.Open "SELECT * FROM TenderSubCategory", Connection, 2, 2
Dim Personal_Selection(50), ColumnID, RowID, ColumnLimit
Personal_Select = Split(Personal_Options("SelectedSubSections"),";")
ColumnID = 1
RowID = 1
ColumnLimit = 4
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Response.write("<table><tr>")
Do While NOT TenderSubCategory.EOF
'
IF ColumnID <= RowID * ColumnLimit THEN
Response.write("<td>" & TenderSubCategory("SubCategoryId") & ": " & TenderSubCategory("SubCategoryName") & "</td><td><input type=""checkbox"" value=" & TenderSubCategory("SubCategoryId"))
for i = 1 to ubound(Personal_Select)
if Personal_Select(i) = TenderSubCategory("SubCategoryId") then
Response.write(" Checked")
end if
Next
Response.write("></td>")
ColumnID = ColumnID + 1
ELSE
Response.write("</tr>")
Response.write("<tr>")
TenderSubCategory.MovePrevious()
RowID = RowID + 1
END IF
TenderSubCategory.MoveNext
Loop
Response.write("</tr></table>")
%>
</body>
</html>
Now the page still shows up, but it doesn't check the boxes as expected. What causes the problem here is that the numbers can be anything from 1 to the limit of the recordset.. So it could be 1;5;20;21;34;44;50 so what I want to do, is check the checkboxes that the user had previously checked and saved.
If you are able to view it, which your currently online now, you can see the output at:
http://82.39.11.101/voicecontacts/select.asp
The numbers are the recordset id, the names are the title of the subscription, and of course the checkboxes values are the recordset id.
Cheers
Gavin
Bookmarks