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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here


    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! Cook up Web sites fast with CakePHP, Part 4: Use CakePHP&apos;s Session and Request Handler components

    CakePHP is a stable production-ready, rapid-development aid for building Web sites in PHP. This "Cook up Web sites fast with CakePHP" series shows you how to build an online product catalog using CakePHP.
    FREE! Go There Now!


    NEW! Download a free trial of Lotus Quickr 8.0

    Visit IBM developerWorks to download a free trial version of Lotus Quickr 8.0, which enables collaboration by transforming the way everyday business content such as documents, rich media, photos, and video can be shared. Lotus Quickr makes it faster and easier to share content of all types (not just documents) within virtual teams. It is designed to make it easier to collaborate across organizational boundaries, while continuing to work within the context of familiar desktop applications.
    FREE! Go There Now!


    NEW! Evaluate WebSphere Extended Deployment Compute Grid V6.1

    Visit IBM developerWorks to download a free trial version of WebSphere Extended Deployment Compute Grid, which lets you schedule, execute, and monitor batch jobs. Because online transaction processing and batch jobs execute simultaneously on the same server resources, you can avoid costly duplication of resources. Compute Grid supports job types of Java transactional batch, compute-intensive and a new type called "native execution", which enables non-Java workloads to run on distributed end points.
    FREE! Go There Now!


    NEW! Hacking 101

    Join us for this web seminar to learn how you can defend your web applications from attack. Learn about the 3 most common web application attacks, including how they occur and what can be done to prevent them. We’ll also discuss manual versus automated approaches for scanning and identifying web application vulnerabilities and how IBM Rational AppScan, an automated vulnerability scanner, can help you automate more of what you are doing manually today.
    FREE! Go There Now!


    NEW! Project and Portfolio Management Executive Resource Kit

    Portfolio Management is about effectively managing portfolio value by aligning portfolio investments with business goals. This complimentary e-kit provides a collection of materials that can help you understand how IBM Rational enables and automates best practices for improved governance and clear visibility into portfolio and project performance across the entire IT project lifecycle.
    FREE! Go There Now!


    NEW! Software Change and Configuration Management Solution Guidelines

    This whitepaper provides areas to consider when evaluating any software configuration management solution. It addresses how the IBM solutions (Rational ClearCase and Rational ClearQuest) meet the needs and requirements of both project leaders and developers to provide successful Software Change and Configuration Management.
    FREE! Go There Now!


    NEW! Test terminal-based applications with Rational Functional Tester

    Regression testing -- in which code is thoroughly tested to ensure that changes have not produced unexpected results -- is an important part of any development process. But many testing environments neglect the terminal-based applications that still form the backbone of many industries. In this tutorial, you'll learn how the Rational Functional Tester Extension for Terminal-Based Applications works with other Rational Functional Tester to help test terminal-based applications quickly and easily.
    FREE! Go There Now!


    NEW! Try the IBM SOA Sandbox for Process

    Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly.
    FREE! Go There Now!


    NEW! Using IBM Rational Developer for System z and IBM Rational ClearCase together to manage application development

    Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes.
    FREE! Go There Now!


    NEW! Webcast: Application security testing and Web compliance

    Join the IBM Watchfire team for an informative discussion on techniques and best practices to proactively manage Web application security and how to effectively build application security testing into the software development lifecycle (SDLC). In this Software Delivery Platform webcast you will learn: How to better understand potential web application security vulnerabilities, best practices and how to effectively integrate application security testing into the software development lifecycle, the importance of detecting and removing software vulnerabilities during application development.
    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-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway