ASP Code
  Home arrow ASP Code arrow Two linked combos populated using remote s...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP CODE

Two linked combos populated using remote scripting.
By: Adrian Forbes
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2003-01-01

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT



    This is the remote scripting file used by RSCombos and RSTreeView.htm.  Note:that with the remote scripting samples there is a hard-coded path to the relevant support files, this will have to be changed appropriately for people to get the demos to work on their own system.  These demo's only work with Internet Explorer 5.0. 

    First Page--RSCombos.htm

    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE>Two Combos using Remote Scripting</TITLE>
    </HEAD>
    <BODY>
    <!-- Author: Adrian Forbes -->
    <script language="JavaScript" src="../_scriptlibrary/rs.htm"></script>
    <script language="JavaScript">RSEnableRemoteScripting("../_scriptlibrary");
    </script>
    <p>
    <select onChange="PopulateChildren()" name=cboParents ID=cboParent size=1>
    &nbsp;</select><select name=cboChildren ID=cboChildren size=1></select>
    </p>

    <script language=VBScript>
    strDBPage = "RSDatabase.asp"

    sub Window_onLoad
        PopulateParent
        PopulateChildren
    end sub

    sub PopulateParent

        set objParents = document.all("cboParents")
        set objRS = RSExecute(strDBPage ,"GetDBParents")
        sRS = objRS.return_value
        aRows = Split(sRS, Chr(13))

        for i = 0 to UBound(aRows) - 1
            aFields = Split(aRows(i), ";")
            set objOption = document.createElement ("OPTION")
            objOption.Value = aFields(0)
            objOption.Text = aFields(1)
            objParents.add objOption
        next
    end sub

    sub PopulateChildren
        set objParents = document.all("cboParents")
        set objChildren = document.all("cboChildren")
        while objChildren.length > 0
            objChildren.remove (0)
        wend
       
        set objRS = RSExecute(strDBPage ,"GetDBChildren", objParents.value)
        sRS = objRS.return_value
        aRows = Split(sRS, Chr(13))

        for i = 0 to UBound(aRows) - 1
            aFields = Split(aRows(i), ";")
            set objOption = document.createElement ("OPTION")
            objOption.Value = aFields(0)
            objOption.Text = aFields(1)
            objChildren.add objOption
        next
    end sub
    </script>
    </BODY>
    </HTML>

    Page 2 RSDatabase.asp

    <%@ LANGUAGE=VBSCRIPT %>
    <%
    strconn = "Driver={SQL Server};Description=sqldemo;SERVER=127.0.0.1;
    UID=LoginID;PWD=Password;DATABASE=Database_Name
    %>
    <% RSDispatch %>
    <!-- Author: Adrian Forbes -->
    <!--#INCLUDE FILE="../_ScriptLibrary/rs.asp"-->
    <SCRIPT RUNAT=SERVER Language=javascript>
        function Description()
        {
            this.GetDBParents = Function( 'return GetDBParents()' );
            this.GetDBChildren = Function('ID', 'return GetDBChildren(ID)' );
            this.Method1 = Method1;
        }
        public_description = new Description();

    function Method1()
    {
        return 'Test';
    }
    </script>

    <SCRIPT RUNAT=SERVER Language=VBScript>
        function GetDBParents()

            set objRS = createobject("ADODB.Recordset")
            objRS.Open "select ID, strParent from Parents", strconn
            GetDBParents = objRS.GetString(, , ";")
            objRS.Close
            set objRS.ActiveConnection = nothing
            set objRS = nothing
           
        end function

        function GetDBChildren(ID)

            set objRS = createobject("ADODB.Recordset")
            objRS.Open "select ID, strChild from Children WHERE intParent=" & ID, strconn
            GetDBChildren = objRS.GetString(, , ";")
            objRS.Close
            set objRS.ActiveConnection = nothing
            set objRS = nothing
           
        end function
    </SCRIPT>





    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More ASP Code Articles
    More By Adrian Forbes

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Accelerating Software Innovation on i on Power Systems

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, for an overview of Rational’s new software offerings and resources to help modernize and accelerate software innovation on i on Power Systems – while ensuring past application investments are protected and continue to grow. Learn how these solutions are helping customers extend their core i5/OS solutions toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Hello World: Monitor a simple business process using WebSphere Business Monitor V6.0.2

    This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product.
    FREE! Go There Now!


    NEW! IBM Rational AppScan Standard Edition V7.7

    Secure your Web applications with IBM Rational AppScan Standard Edition V7.7, previously known as Watchfire AppScan. This Web application security testing tool automates vulnerability assessments and scans and tests for common Web application vulnerabilities. Visit IBM developerWorks to download a free trial of IBM Rational AppScan Standard Edition V7.7.
    FREE! Go There Now!


    NEW! Improve your build process with IBM Rational Build Forge, Part 2: Automate builds for a real-world Tomcat project

    Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available.
    FREE! Go There Now!


    NEW! Krugle, developerWorks, and code search

    Ken Krugler, co-founder of code search company Krugle, and Laura Merling, vice president of Marketing and Business Development for Krugle, join to talk about the ins and outs of code search and what it means as a new feature for developerWorks users.
    FREE! Go There Now!


    NEW! Maintaining QoS and Process Integrity in an SOA Environment

    This webcast outlines the best practices that must be instituted to gain the maximum benefit from SOA while maintaining high quality of service. Whether you are deploying new applications or managing and monitoring your existing infrastructure, learn how you can ensure high quality of services with SOA based solutions from IBM. All registrants who attend this live Web Seminar will receive complimentary access to a white paper titled “Maintaining QoS in an SOA Environment”.
    FREE! Go There Now!


    NEW! Trial download: IBM Rational Functional Tester V7.0.1

    Get a free trial download of the latest version of IBM Rational Functional Tester V7.0.1. Rational Functional Tester is an automated functional and regression testing solution for QA teams concerned with the quality of their Java, Microsoft Visual Studio .NET, and Web-based applications.
    FREE! Go There Now!


    NEW! Trial download: IBM Rational Tester for SOA Quality V7.0.1

    Get a free trial download of the latest version of IBM Rational Tester for SOA Quality V7.0.1, a functional and regression testing tool that enables the creation, comprehension, modification and execution of testing GUI-less Web services.
    FREE! Go There Now!


    NEW! Webcast: Accelerating Software Innovation with System z

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Webcast: What is new in Viper 2 for developers?

    Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    ASP CODE ARTICLES

    - ASP Forms
    - ASP: The Beginning
    - Getting Remote Files With ASP Continued
    - Inbox and Outbox Manipulation in ASP
    - Relational DropDownList Using VB.NET
    - Ad Tracking URL Hits
    - Use ViewState to display one record per page...
    - Send Email using ASP.NET formatted in HTML
    - ASP File Explorer
    - ASP/XML Interview questions by Srivatsan Sri...
    - Various methods of setting Date values to a ...
    - Conditional DataGrid Item and using checkbox...
    - Fill .NET Listbox with SQL DataReader
    - Filling Dropdown box using Code-Behinds in C#
    - FLAMES code sample written in .NET What is F...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek