checkbox values to dropdown
Hello,
I posted this in the wrong forum earlier so please forgive me. What I'm currently have now is a bunch of check boxes that pass values to crystal reports. I need to change the checkboxes to dropdowns. Sounds simple, but I keep running into wallls. I think it has to do wtih the sub sbprintchoices. please hellllp! thanks.
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim dFrom, dTo
Dim iIncidentID
Dim aTypeID, aStatusID,aPayGradeID
aTypeID = Split(Request.Form("chkTypeID"), ",")
aStatusID = Split(Request.Form("chkStatusID"), ",")
aPayGradeID = Split(Request.Form("chkPayGradeID"), ",")
iIncidentID = 0
%>
<html>
<head>
<title>Test Report</title>
</head>
<body>
<form name="frmSelect" action="rep1.aspx" method="post" onsubmit="return fnCheck();">
<table border="0">
<td valign="top">
<b>STATUS</b>
<table cellpadding="0" cellspacing="0">
<%
sbPrintChoices ROOT_ID, CAT_STATUS, 0, aStatusID
%>
<b>STATUS2</b>
<table>
<%
sbPrintChoices ROOT_ID, CAT_STATUS2, 0, aStatus2ID
%>
</table>
<%
Sub sbPrintChoices(ByVal iParentID, ByVal iCat, ByVal iPad, ByRef aID)
Dim aChild, i, sCat, sID
Select Case iCat
Case CAT_STATUS
sCat = "Status"
sSQL = "SELECT tbl_Status.sta_StatusID,tbl_Status.sta_Status, tbl_SubStatus.sst_Type,tbl_SubStatus.sst_Multiple, tbl_SubStatus.sst_Type " & _"FROM tbl_Status INNER JOIN tbl_SubStatus ON tbl_Status.sta_StatusID = tbl_SubStatus.sst_ChildID " & _"WHERE tbl_SubStatus.sst_ParentID = " & iParentID & " ORDER BY tbl_Status.sta_StatusID"
Case CAT_PAYGRADE
sCat = "PayGrade"
sSQL = "SELECT pay_PayGradeID, pay_PayGrade, 0 AS theType FROM tbl_Paygrade ORDER BY pay_PayGradeID"
End Select
openRst sSQL, "", "", "", "", ""
If Not oRst.EOF Then aChild = oRst.GetRows
closeRst
If IsArray(aChild) Then
For i = LBound(aChild, 2) To UBound(aChild, 2) %>
<tr><td style="padding-left:<%=iPad%>px;">
<% If aChild(CLD_TYPE, i) <> 2 Then %>
<input type=checkbox id="chk<%=sCat%>ID" name="chk<%=sCat%>ID" value="<%=aChild(CLD_ID, i)%>"
<%
If IsArray(aID) Then
For Each sID In aID
If CInt(sID) = aChild(CLD_ID, i) Then Response.Write " checked"
Next
End If
Response.Write "/> " & aChild(CLD_NAME, i)
Response.Write "<br/>" & vbCrLf
Else
Response.Write " [u]" & aChild(CLD_NAME, i) & "</u><br/>" & vbCrLf
End If
Response.Write " </td></tr>" & vbCrLf
If iCat = CAT_STATUS Or iCat = CAT_TYPE Then _
sbPrintChoices aChild(CLD_ID, i) , iCat, iPad + 10, aID
Next
End If
End Sub
%>
|