[OTP] vbscript problem  
Author Message
december





PostPosted: Visual Basic IDE, [OTP] vbscript problem Top

Hello,

Im not sure if this is in the right place, but I'll give it a try. I have an app that pass values to crystal reports from checkboxes. I need to change those checkboxes to dropdown menus. I think my problem lies within the sub sbPrintChoices. I'm new to this, and have tried soo many ways to get this thing to work. Any help is appreciated.


<% 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
%>


Visual Basic10  
 
 
spotty





PostPosted: Visual Basic IDE, [OTP] vbscript problem Top

You are using VBScript and these forums relate to VB.NET. VB Script refers to the script language used in client-side Web pages. Which is based upon an older much less sophisticated version of VB.

you could try the forums at http://forums.asp.net/

A good source of information on scripting is, but this doesn’t have forums, newsgroups as such.

http://www.microsoft.com/technet/scriptcenter/default.mspx

One client-side script forum is here: http://forums.asp.net/130/ShowForum.aspx