Location: PHPKode > scripts > Ajax Linked Select boxes > example_8.php
    <html>
        <head>
            <title>Salix.gr - Linked selected boxes demo page</title>
            <META NAME="author" CONTENT="Panos Kyriakakis">
            <meta name="description" lang="en" content="Demo page. Linked selected boxes that load items from database using AJAX">
            <meta name="keywords" lang="en" content="Demo page, Linked selected boxes, Content management, Components and tools to manage content, AJAX, Interact with the Web server without page reloading">
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <META name="verify-v1" content="2CKKXxDtxsHjE7TjmXjWJSzMj5xqXOvTrnZ27goGJSE=" />
            <META name="robots" content="follow,index" />
            <link href="http://www.salix.gr/forAll.css" rel="stylesheet" type="text/css"></link>
        </head>
        <body>
        <script src="prototype.js" type="text/javascript"></script>

        <?php
      
    	  include("top_script.php");    
        include("sc_classes.php");
        
        
        $sc_ajax_updater = new sc_ajax_updater();     
        $sc_ajax_updater->set_updater_items('jerry','rec_id',1,array('fld1' => 'tag1', 'fld2' => 'tag2', 'fld3' => 'tag3'));
        $sc_ajax_updater->place_jscripts('popo');


        $sc_ajax_select_boxes = new sc_ajax_select_boxes();     
        $sc_ajax_select_boxes->xml_encoding='ISO-8859-1';   // use this property if you need other encoding than latin
        $sc_ajax_select_boxes->add_select_box('sc_page_types','page_type','type_descr','page_type','','sel1','sel_id_1','');
        $sc_ajax_select_boxes->add_select_box('sc_page_types_sub','sub_type','type_descr','sub_type','st21','sel2','sel_id_2','');
        $sc_ajax_select_boxes->add_select_box('sc_page_types_sub_sub','sub_type','type_descr','sub_type','st22','sel3','sel_id_3','');
        $sc_ajax_select_boxes->add_select_box('sc_page_types_sub_sub','sub_type','type_descr','sub_type','st22','sel4','sel_id_4','');
        $sc_ajax_select_boxes->link_select_boxes('sel1','sel2', 'page_type','t2');
        $sc_ajax_select_boxes->link_select_boxes('sel2','sel3', 'page_type','st22');
        $sc_ajax_select_boxes->link_select_boxes('sel3','sel4', 'page_type','st22');
        $sc_ajax_select_boxes->place_jscripts();
        $sc_ajax_select_boxes->show_select_box('sel1');echo '<br />';
        $sc_ajax_select_boxes->show_select_box('sel2');echo '<br />';
        $sc_ajax_select_boxes->show_select_box('sel3');echo '<br />';
        $sc_ajax_select_boxes->show_select_box('sel4');echo '<br />';

        
        ?>
        <br />
<input name="tag1" id="tag1" value="">
<input name="tag2" id="tag2" value="">
<div id="tag3"></div>

<input type="button" value="click me" onclick="sc_popo(1)" />
<input type="button" value="clean" onclick="sc_popo_clean()" />

	<script type="text/javascript">
	    
	    Event.observe(window, 'load', initSearch, false);
	    
	    function initSearch() {
		    Event.observe('sel_id_4', 'change', doGetRow, false);
		  }
		  
  		function doGetRow(){
  			var key_val;

  			if( $('sel_id_4')!=null);
  			  key_val= $('sel_id_4').value;
  			if( key_val!='0' ) {
  			  sc_popo(key_val.replace(/st/,''));
  			}
  			    
  		}
  		
	</script>
<div id="dump_area"></div>
        </body>
    </html>
Return current item: Ajax Linked Select boxes