Do I have to convert the code?? - 3/30/2001 15:54:00
Ok, I found the following code that will dynamically change the contents of a drop-down box based on user input. My question is, Since this is written in JavaScript, can I add VB Script to it, to be able to pull information from a SQL Database to populate the boxes or am I going to have to attempt to convert the entire script over into VB Script?<SCRIPT Language="JavaScript"><!-- //Build arrays for each person's contacts Contacts=new Array(4); Contacts[0]=new Array(3); Contacts[1]=new Array(2); Contacts[2]=new Array(5); Contacts[3]=new Array(4); //Warehouse Contacts[0][0]="Monday"; Contacts[0][1]="Tuesday"; Contacts[0][2]="Wednesday"; Contacts[0][3]="Thursday"; Contacts[0][4]="Friday"; //Local Contacts[1][0]="Route 1"; Contacts[1][1]="Route 2"; //Rural Contacts[2][0]="Franklin"; Contacts[2][1]="Hermitage"; Contacts[2][2]="Brentwood"; Contacts[2][3]="Bellvue"; Contacts[2][4]="Inglewood"; Contacts[2][5]="Smyrna"; Contacts[2][6]="Lavergne"; Contacts[2][7]="Murfreesboro"; Contacts[2][8]="Antioch"; Contacts[2][9]="Donelson"; Contacts[2][10]="Berry Hill"; Contacts[2][11]="Tusculum"; //Call this to build the Contact list for the specified Salesperson function BuildContacts(num) { //Select the first Contact document.myForm.SalesContacts.selectedIndex=0; //For every contact in the array for this person, add a new option for(ctr=0;ctr<Contacts[num].length;ctr++) { document.myForm.SalesContacts.options[ctr]=new Option(Contacts[num][ctr],Contacts[num][ctr]); } //Set the length of the select list document.myForm.SalesContacts.length=Contacts[num].length; } //--></Script>
------------------ Wes The world would be a better place if stupidity hurt SCSI Business Solutions
|