|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Variable Arrays from database for Select and Span
I am working on a site with MS Access and ASP that needs to have data selected from a listbox, populate several span fields. I can do it with JavaScript but the array data is hard coded, I want the data brought in dynamically from an Access database.
Here is my JavaScript code: <<<<<<< <script language="JavaScript"> var textdisplay=new Array() textdisplay[0]='-select-' textdisplay[1]='CompanyA' textdisplay[2]='CompanyB' var hourstext=new Array() hourstext[0]='-select-' hourstext[1]='4' hourstext[2]='8' var periodtext=new Array() periodtext[0]='-select-' periodtext[1]='2 years' periodtext[2]='3 years' function displaydesc(which) { if (document.all) descriptions.innerHTML=textdisplay[which] hours.innerHTML=hourstext[which] period.innerHTML=periodtext[which] elseif (document.getElementByID) document.getElementById("provider").innerHTML=textdisplay[which] document.getElementById("hours").innerHTML=hourstext[which] document.getElementById("period").innerHTML=periodtext[which] } displaydesc(document.ddmessage.selectbox.selectedIndex) document.ddmessage.selectbox.options[0].selected=true </script> .... <tr> <td width="25%"> <select size="1" name="selectbox" onChange="displaydesc(document.ddmessage.selectbox.selectedIndex)"> <option selected value="">-select-</option> <option value="Basic">Basic</option> <option value="Advanced">Advanced</option> </select></td> <td width="25%"><span id="provider" align="left"></span></td> <td width="25%"><center><span id="hours" align="left"></span></center></td> <td width="25%"><span id="period" align="left"></span></td> </tr> >>>>> With Access and ASP, I want to have a listbox (selectbox) get information from a database (tblClassType) then populate a few Span fields with corresponding information such as provider, hours, period. Any help would be appreciated. Thanks. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Variable Arrays from database for Select and Span |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|