Code Examples
  Home arrow Code Examples arrow Two linked dropodown boxes populated using...
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 
VeriSign Whitepapers 
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? 
CODE EXAMPLES

Two linked dropodown boxes populated using remote scripting
By: aspfree
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2000-02-28

    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 Code Examples Articles
    More By aspfree

     

    IBM® developerWorks developerWorks - FREE Tools!


    Build Forge Express demo: Enabling software delivery excellence for small and midsized businesses

    This demonstration gives you an overview of IBM® Rational® Build Forge Express Edition, a global offering that provides a framework to automate and execute software processes. Rational Build Forge provides a software assembly line that can support all of your tools, technologies, and platforms so you can achieve a repeatable, reliable, and traceable build and release process.
    FREE! Go There Now!


    IBM DB2 Deep Compression ROI Tool

    The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times.
    FREE! Go There Now!


    NEW! Best practices for software analysis: An introduction to the IBM Rational Software Analyzer application

    This whitepaper presents the benefits of successfully introducing static analysis into your organization using IBM Rational Software Analyzer. Additionally, it identifies some common pitfalls that can hinder the effective use of static analysis tooling as well as presents 10 simple strategies designed to help you quickly realize the value of static analysis using Rational Software Analyzer.
    FREE! Go There Now!


    NEW! Rational Modeling Extension for Microsoft.Net

    Rational Modeling Extension for Microsoft .NET enhances usability for code generation supporting a more intelligent refactoring. The latest enhancements enable organizations with Java and .NET systems and software development maintain architectural integrity across heterogeneous platforms.
    FREE! Go There Now!


    NEW! Rational Talks to You: Grady Booch on Architecture

    Join this Rational Talks to You teleconference on November 29 at 1:00 pm ET to participate in an interactive discusssion with Grady Booch around architecture and reuse. Get your questions answered!
    FREE! Go There Now!


    NEW! Trial download: IBM Lotus Forms V3.0

    Get a free trial download of IBM Lotus Forms V3.0 (formerly Workplace Forms), which provides a zero-footprint eForms solution to help you automate and move forms-based business processes off the desktop and onto the Web. With Lotus Forms, you can extend applications beyond the firewall by creating a single electronic form document ready for use in both thick and Web 2.0 thin client format.
    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! Understanding Web application security challenges

    As businesses grow increasingly dependent upon Web applications, these complex entities grow more difficult to secure. Most companies equip their Web sites with firewalls, Secure Sockets Layer (SSL), and network and host security, but the majority of attacks are on applications themselves – and these technologies cannot prevent them. This paper explains what you can do to help protect your organization, and it discusses an approach for improving your organization’s Web application security.
    FREE! Go There Now!


    NEW! Webcast: Calling All Testers! Find Application Vulnerabilities Early in the Development Process Where they are Easier to Fix and Less Risky to your Business

    In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information.
    FREE! Go There Now!


    NEW! Whitepaper: Achieving consistency between business process models and operational guides

    Explore how Rational and WebSphere software enable enterprise documentation in SOA environments. Specifically, a new integration between IBM WebSphere® Business Modeler and IBM Rational® Method Composer software can help technical writers more easily keep enterprise operations manuals in sync with changes that are made to business processes, resulting in more accurate and timely documentation that benefits the entire enterprise.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    CODE EXAMPLES ARTICLES

    - Handling Animations and Bitmaps Using GDI+ f...
    - Download a Web Page using the WebClient
    - Creating a Chart using Data from a Database ...
    - The Basics of Charting with the MS Chart Con...
    - Searching Body Text with textRange: Enter th...
    - Searching Body Text with textRange: Building...
    - Searching Body Text with textRange, part 1: ...
    - First Steps in Programming
    - Programming in C
    - Quick Introduction to ASF,ASX, and Networkin...
    - SatView: Pointer Perfect, Part 2: Constructi...
    - SatView: Pointer Perfect, Part 1
    - Style Case Studies: Construction Unions
    - Creating an Engine for Games for Windows
    - Style Case Studies: Generic Callbacks





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway