ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 15th, 2004, 08:10 PM
techwreck techwreck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 14 techwreck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 11 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Variable Arrays from database for Select and Span


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT