@vwphillipsJan 11.2008 — #[CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head> <title></title> <script language="JavaScript" type="text/javascript"> <!-- /* This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com Created by: Vladimir Geshanov | */ var arrayData = new Array(); arrayData[0] = 'SALES|[SAL] User 01|' arrayData[1] = 'SALES|[SAL] User 02|' arrayData[2] = 'SALES|[SAL] User 03|' arrayData[3] = 'MARKETING|[MAR] User 01|' arrayData[4] = 'MARKETING|[MAR] User 02|' arrayData[5] = 'MARKETING|[MAR] User 03|' arrayData[6] = 'TECHNOLOGY|[TEC] User 01|' arrayData[7] = 'TECHNOLOGY|[TEC] User 02|' arrayData[8] = 'TECHNOLOGY|[TEC] User 03|' var arrayData2 = new Array(); arrayData2[0] = '[SAL] User 01|Tom 1' arrayData2[1] = '[SAL] User 01|Dick 1' arrayData2[2] = '[SAL] User 01|Harry 1' arrayData2[3] = '[SAL] User 02|Tom 2' arrayData2[4] = '[SAL] User 02|Dick 2' arrayData2[5] = '[SAL] User 02|Harry 2' arrayData2[6] = '[SAL] User 03|Tom 3' arrayData2[7] = '[SAL] User 03|Dick 3' arrayData2[8] = '[SAL] User 03|Harry 3' arrayData2[9] = '[MAR] User 01|Tom 4' arrayData2[10] = '[MAR] User 01|Dick 4' arrayData2[11] = '[MAR] User 01|Harry 4' arrayData2[12] = '[MAR] User 02|Tom 5' arrayData2[13] = '[MAR] User 02|Dick 5' arrayData2[14] = '[MAR] User 02|Harry 5' arrayData2[15] = '[MAR] User 03|Tom 6' arrayData2[16] = '[MAR] User 03|Dick 6' arrayData2[17] = '[MAR] User 03|Harry 6' arrayData2[18] = '[TEC] User 01|Tom 7' arrayData2[19] = '[TEC] User 01|Dick 7' arrayData2[20] = '[TEC] User 01|Harry 7' arrayData2[21] = '[TEC] User 02|Tom 8' arrayData2[22] = '[TEC] User 02|Dick 8' arrayData2[23] = '[TEC] User 02|Harry 8' arrayData2[24] = '[TEC] User 03|Tom 9' arrayData2[25] = '[TEC] User 03|Dick 9' arrayData2[26] = '[TEC] User 03|Harry 9'
function populateData( name,tar,ary ) { var select = window.document.form[tar]; var string = ""; // 0 - will display the new options only // 1 - will display the first existing option plus the new options var count = 0;
// Clear the old list (above element 0) select.options.length = count;
// Place all matching categories into Options. for( i = 0; i < ary.length; i++ ) { string = ary[i].split( "|" ); if( string[0] == name ) { select.options[count++] = new Option( string[1] ); } }
// Set which option from subcategory is to be selected // select.options.selectedIndex = 2; // Give subcategory focus and select it // select.focus(); }