[OTP] vbscript problem  
Author Message

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


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

<title>Test Report</title>
<form name="frmSelect" action="rep1.aspx" method="post" onsubmit="return fnCheck();">
<table border="0">
<td valign="top">
<table cellpadding="0" cellspacing="0">
sbPrintChoices ROOT_ID, CAT_STATUS, 0, aStatusID

sbPrintChoices ROOT_ID, CAT_STATUS2, 0, aStatus2ID

Sub sbPrintChoices(ByVal iParentID, ByVal iCat, ByVal iPad, ByRef aID)
Dim aChild, i, sCat, sID

Select Case iCat
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"

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

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"
End If
Response.Write "/> " & aChild(CLD_NAME, i)
Response.Write "<br/>" & vbCrLf
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


End If
End Sub

Visual Basic1  

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.


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