Hi
im creating this form where a bunch of servers are listed with checkboxes beside each.(the servers are pulled out of a sql tble). A user can any server. Once the user clicks the submit button, form validation occurs to see if any of the form fields is empty. If one of the fields is empty, then a message at the top of the screen will tell the user to complete the form. MY problem is to disply the server list and the servers that the user selected before submitting. Basically i want to take the servers that the user selected before sumitting, and display it. Here is my code:
Sub CheckServersChecked()
oConn.Open(ConnectionString)
sqlQuery1 = "SELECT serverName, serverLocation FROM tblInventoryServers WHERE (serverStateType = 'Locked' OR serverStateType = 'Controlled') AND (serverStatus = 'Online' OR serverStatus = 'Offline')"
Set oRs1 = oConn.Execute(sqlQuery1)
serverString = oRs1("serverName")
'serverSelect = Request("server")
strList = Request("server")
list = Replace(strList, "/", "")
list = Replace(list, " ", "")
serverArray =Split(list,",")
WHILE NOT oRs1.EOF
'if serverlist is not empty then add a ticked checkbox for each server
if strList <> "" Then
for x =0 to UBound(serverArray)
Response.Write serverArray(x)
selectCheckBox = "checked"
Response.Write "<br/>"
Next
Response.Write "<input type='checkbox' name='server' id='serverSelect' "& selectCheckBox &" value=" & serverString & "/>"
else
Response.Write oRs1("serverName")
Response.Write "<input type='checkbox' name='server' id='serverSelect' value=" & serverString & "/>"
Response.Write "<br/>"
end if
oRs1.MoveNext
WEND
oRs1.Close
oConn.Close
End Sub
im creating this form where a bunch of servers are listed with checkboxes beside each.(the servers are pulled out of a sql tble). A user can any server. Once the user clicks the submit button, form validation occurs to see if any of the form fields is empty. If one of the fields is empty, then a message at the top of the screen will tell the user to complete the form. MY problem is to disply the server list and the servers that the user selected before submitting. Basically i want to take the servers that the user selected before sumitting, and display it. Here is my code:
Sub CheckServersChecked()
oConn.Open(ConnectionString)
sqlQuery1 = "SELECT serverName, serverLocation FROM tblInventoryServers WHERE (serverStateType = 'Locked' OR serverStateType = 'Controlled') AND (serverStatus = 'Online' OR serverStatus = 'Offline')"
Set oRs1 = oConn.Execute(sqlQuery1)
serverString = oRs1("serverName")
'serverSelect = Request("server")
strList = Request("server")
list = Replace(strList, "/", "")
list = Replace(list, " ", "")
serverArray =Split(list,",")
WHILE NOT oRs1.EOF
'if serverlist is not empty then add a ticked checkbox for each server
if strList <> "" Then
for x =0 to UBound(serverArray)
Response.Write serverArray(x)
selectCheckBox = "checked"
Response.Write "<br/>"
Next
Response.Write "<input type='checkbox' name='server' id='serverSelect' "& selectCheckBox &" value=" & serverString & "/>"
else
Response.Write oRs1("serverName")
Response.Write "<input type='checkbox' name='server' id='serverSelect' value=" & serverString & "/>"
Response.Write "<br/>"
end if
oRs1.MoveNext
WEND
oRs1.Close
oConn.Close
End Sub