Index
Index 2
Why I use Linux and Firefox
HTML DB & Javascript
The Basics
Enable/Disable Form Items
HTML DB Javascript Remix
Show/Hide/Toggle Form Items
htmldb_Get Introduction
AJAX & DHTML
AJAX
Set Multiple Items
(AJAX) Auto Update Report
(AJAX) Collection Control
(AJAX) Process On Demand
(AJAX) Report Pull
(AJAX) Report Row with Detail
(AJAX) Select Items
(AJAX) Set Item Value
(AJAX) Tree
htmldb_Get Aysnc Extension
DHTML
Form Element Focus
Progress Meter On Submit
Region Tabs
Report Row With Detail (iframe)
Report Row with Detail
Shuttle (Item Based)
Shuttle (PL/SQL Based)
Smart Table
List (DHTML Tree)
Show/Hide Report Columns
HTML DB Usage
Linked Reports
HTML/CSS/Layout
HTML DB DHTML Tree
Region Position
Report Row Templates
Multi Region Form Layout
Vertical Aligned Regions
Layout Example
SVG / Canvas
Canvas #1
Custom Charts
Thermometer
Scatter (Coming Soon)
Timeline (Coming Soon)
SVG Knowledge Tree
Pie Chart CSS
Bar Spacing
Application Exports / CSS / JS
Select List innerHTML
Select List without innerHTML
Select 1
Cat
Cow
Dog
Lion
Select 2
Will_Go_Away1
Will_Go_Away2
Will_Go_Away3
Will_Go_Away4
Javascript
Javascript
<script language="JavaScript" type="text/javascript"> function switch_Select(pThis,pThat){ // destination select var l_That = document.getElementById(pThat); // value from first select var l_ThisValue = pThis.options[ pThis.selectedIndex ].value // this would be the string returned from AJAX call // the colons separate the options // the commas separate the label and value of each option element var l_testString = 'county 1,V1:county 2,V2:county 3,V3:county 4,V4'; // create array with element for each option var l_testArray = l_testString.split(":"); // only get array length once because it's slightly faster; var l_Array_Length = l_testArray.length; // clear destination select l_That.options.length = 0; // add option nodes into destination select for(var i=0; i < l_Array_Length; i++) { // split array element to get option label and option value var l_TempArray = l_testArray[ i ].split(","); var l_newValue = l_ThisValue + '-' + l_TempArray[ 0 ]; var l_newReturn = l_TempArray[ 1 ]; l_That.options[ i ] = new Option(l_newValue,l_newReturn); } } </script>