Advertisement

02.07.2006 at 02:10PM PST, ID: 21727632
[x]
Attachment Details

Change dynamic dropdown to Check boxes ASP Java script

Asked by tmurray22 in Active Server Pages (ASP)

Tags: check, asp, dropdown

I have a form that does some dynamic dropdowns based on the selection of dropdown above.
I would like to make the last dropdown "Build" a selection of checkboxes on another page.

Here is my code

<%@ Language = VBScript %>
<%Option Explicit%>
<%Response.Buffer = True%>
<HTML>
<HEAD>

<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<%
dim  strDataPath, strConnectString, objConnection, strRelease, strOS, strBuild, objRS, strSelected, oConn, oRs, MySQL, connect


strRelease = Request.Form("Release")
strOS = Request.Form("OS")
strBuild = Request.Form("Build")
    'set oConn = Server.CreateObject("ADODB.Connection")
    'strConnectString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("fpdb\ptdb\PVSdata.mdb") & ";Persist Security Info=False"
    'oConn.Open connect


'set connection strings for entire application
'strDataPath = server.MapPath("fpdb\ptdb\PVSdata.mdb")
strConnectString = "Provider=Microsoft.Jet.OLEDB.4.0; DATA SOURCE= "& Server.MapPath("fpdb\ptdb\PVSdata.mdb")
                  
if not IsObject("ojbConnection") then
      set objConnection=Server.CreateObject("ADODB.Connection")
      objConnection.ConnectionTimeout = 15
      objConnection.CommandTimeout =  10
      objConnection.Mode = 3 'adModeReadWrite
      if objConnection.state = 0 then
            objConnection.Open strConnectString
      end if
end if

sub makeCountry()
      if not isObject("objRS") then
            set objRS=Server.CreateObject("ADODB.RecordSet")
      end if
      if objRS.state <> 0 then
            objRS.close
      end if
      objRS.Open "SELECT DISTINCT Release FROM SysInfo ORDER BY Release",objConnection,3,3
      Response.Write("<option></option>" & VBCRLF )
      do while not objRS.EOF
            if objRS("Release") = strRelease then
                  strSelected = " Selected "
            else
                  strSelected = ""
            end if
            Response.Write("<option" & strSelected & ">" & objRS("Release") & "</option>" & VBCRLF )
            objRS.MoveNext
      loop
      objRS.Close
      set objRS=Nothing
end sub

sub makeRegion()
      if strRelease <> "" then
            if not isObject("objRS") then
                  set objRS=Server.CreateObject("ADODB.RecordSet")
            end if
            if objRS.state <> 0 then
                  objRS.close
            end if
            objRS.Open "SELECT DISTINCT OS FROM SysInfo WHERE Release = '" & strRelease & "' ORDER BY OS",objConnection,3,3
            if objRS.eof then
                  Response.Write("<option>No OS Found</option>")
            else
                  Response.Write("<option>Select OS Now</option>" & VBCRLF )
                  do while not objRS.EOF
                        if objRS("OS") = strOS then
                              strSelected = " Selected "
                        else
                              strSelected = ""
                        end if
                        Response.Write("<option" & strSelected & ">" & objRS("OS") & "</option>" & VBCRLF )
                        objRS.MoveNext
                  loop
            end if
            objRS.Close
            set objRS=Nothing
      else
            Response.Write("<option>Select a Release First</option>")
      end if
end sub

sub makeCity()
      if strOS <> "Select a Release First" AND  strOS <> "Select OS Now" AND strOS <>"" then
            if not isObject("objRS") then
                  set objRS=Server.CreateObject("ADODB.RecordSet")
            end if
            if objRS.state <> 0 then
                  objRS.close
            end if
            objRS.Open "SELECT DISTINCT Build FROM SysInfo WHERE OS = '" & strOS & "' ORDER BY Build",objConnection,3,3
            if objRS.eof then
                  Response.Write("<option>No Builds Found</option>")
            else
                  Response.Write("<option>Select Build Now</option>" & VBCRLF )
                  do while not objRS.EOF
                        if objRS("Build") = strBuild then
                              strSelected = " Selected "
                        else
                              strSelected = ""
                        end if
                        Response.Write("<option" & strSelected & ">" & objRS("Build") & "</option>" & VBCRLF )
                        objRS.MoveNext
                  loop
            end if
            objRS.Close
            set objRS=Nothing
      else
            Response.Write("<option>Select an OS First</option>")
      end if
end sub
%>

<SCRIPT LANGUAGE=javascript>
<!--

function submitCountry(){
      var objForm = document.forms[0];
      objForm.elements['OS'].selectedIndex=0;
      objForm.elements['Build'].selectedIndex = 0;
      objForm.submit();
}
function submitRegion(){
      var objForm = document.forms[0];
      objForm.elements['Build'].selectedIndex = 0;
      objForm.submit();
}

function submitForm(){
      var objForm = document.forms[0];
      objForm.action = "http://pysdoorway/scm/nebulous2.asp"
      return true;
}
//-->
</SCRIPT>

</HEAD>
<BODY>
<FORM action="--WEBBOT-SELF--" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<!--webbot bot="SaveResults" U-File="nebulous.asp" S-Format="HTML/BR" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE" S-Email-Address="teg@rmc.py.intel.com" B-Email-Label-Fields="TRUE" S-Builtin-Fields startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" i-checksum="43374" endspan -->
<p align="left">&nbsp;</p>
<p align="center"><font size="6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Personal
Validation Test System<br>
</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;</p>
<p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="#990033"><b>System Information<br>
<br>
</b></font><font size="5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>System&nbsp;<font size="5">
<select size="1" name="System"<%If Request("Dept")<>"" Then%>
value="<%=Request("Dept")%>"
<%End If%>
>
<option><%=Request("System")%></option>
<option>pylnxdilsutPCI</option>
<option>pylnxcpcisutcPCI</option>
</select></font><body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>&nbsp;</p>
<p align="center">&nbsp;&nbsp;&nbsp;&nbsp; Release&nbsp;
<SELECT  name="Release" onChange="submitCountry()">
      <%call  makeCountry%>
</SELECT> <br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; OS&nbsp;
<SELECT  name="OS" onChange="submitRegion()">
      <%call makeRegion%>
</SELECT><br>
<br>
Build Number&nbsp;
<SELECT  name="Build">
      <%call makeCity%>
</SELECT>&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p align="center"><br>

<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com

</script>

</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
&nbsp;</p>


<script language="javascript" type="text/javascript" src="datetimepicker.js">

</script>

</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">


<p align="center">&nbsp;</p>
<p align="center"> <br>
<font size="5">
<INPUT type="submit" value="Submit" id=submit1 name=submit1 style="border-style: inset; border-width: 1px"></font></p>
</FORM>
</BODY>
<%
objConnection.Close
set objConnection = Nothing
%>

</HTML>
Start Free Trial
[+][-]02.07.2006 at 09:29PM PST, ID: 15899801

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2006 at 07:03AM PST, ID: 15902840

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.08.2006 at 11:10AM PST, ID: 15905483

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2006 at 11:11AM PST, ID: 15905489

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2006 at 12:26PM PST, ID: 15906308

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.08.2006 at 12:39PM PST, ID: 15906443

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2006 at 08:59PM PST, ID: 15909971

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.09.2006 at 02:42AM PST, ID: 15911236

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: check, asp, dropdown
Sign Up Now!
Solution Provided By: rnby
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.09.2006 at 12:40PM PST, ID: 15916439

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.09.2006 at 02:11PM PST, ID: 15917286

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.09.2006 at 07:15PM PST, ID: 15919159

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.10.2006 at 05:20AM PST, ID: 15922215

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32