Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 23rd, 2006, 10:45 AM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
%>
 
Old July 3rd, 2006, 08:34 PM
Authorized User
 
Join Date: Jun 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to erobb Send a message via Yahoo to erobb
Default

Can you comment the code that is causing you issues.

Earl






Similar Threads
Thread Thread Starter Forum Replies Last Post
Get The Values In The DropDown vivek_inos Access VBA 1 November 30th, 2005 04:17 PM
Get The Values In The DropDown vivek_inos Access 2 November 30th, 2005 09:45 AM
populating dropdown values rupen Classic ASP Basics 16 October 10th, 2005 09:48 AM
Dropdown values dotnewnewbie ASP.NET 1.0 and 1.1 Professional 5 October 28th, 2003 12:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.