Content Management Code

  Home arrow Content Management Code arrow Cascade Drop Down
CONTENT MANAGEMENT CODE

Cascade Drop Down
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2005-02-02

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    The Basic requirement for me to write a class of this kind is to avoid the page refreshing when it has two drop downs which is depend on another (like parent and child).

    When the page needs to be reloaded it is not pleasant for the users to wait until the page reload is complete, especially when their Internet to the server is slow.

    So what this class does is to generate Javascript code dynamically by fetching the select input option values from a database table and switch them when the user changes the parent select input.

    The class has two basic functions where one is responsible for querying the database and other is responsible for generating the Javascript code.

    There is also a function which is responsible for generating the HTML code for the select input.

    By : gobinathm


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Drop Down Based on First Value</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <?php
    // Script to Query the Concerts Table to Display the results
    /* database configuration */
    $dbConfig['type']="mysql";
    $dbConfig['server']="localhost";
    $dbConfig['username']="******";
    $dbConfig['password']="******";
    $dbConfig['database']="******";

    include_once("JSDropDown.class.php");
    $frmObjName="JSddForm";
    echo "<form name=\"$frmObjName\" method=\"post\">";

    $JSdd = new JSDropDown($dbConfig);
    $JSdd->DataFetch(); // Call the Function which will fetch the data.
    $JSdd->createfrmObject($frmObjName); // Pass the Current Form name as the parameter

    $JSdd->close_JSDropDown_database();
    echo "</form>";
    ?>
    </body>
    </html>


    Click to Download File



    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 Content Management Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    CONTENT MANAGEMENT CODE ARTICLES

    - V2 CMS - Content Management System
    - VSNS Lemon
    - Country List For Forms Using SQL
    - eggblog
    - Table generation class
    - STP Simple Template Parser
    - class Vision_To_Form_Elements
    - Cascade Drop Down
    - Cura - CMS
    - Syntax Desktop
    - 216 color table
    - Simple Mini Poll class library (SimPoll)
    - Regex Generator
    - Siteseed
    - Company WebSite Builder PRO

    Developer Shed Affiliates

     



    © 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap