Link to home
Create AccountLog in
Avatar of freezilla
freezilla

asked on

dynamic javascript array from access db

Ok, I've got something working just fine but it's static and I know you can use ASP within JavaScript.  So I'd like to have this array become dynamic.  One problem, I don't know how to make that happen.

Essentially I want the following array to be dynamic and pulled from my database.

<script language="javascript" type="text/javascript">
function dropdownlist(listindex)
{

document.formname.subcategory.options.length = 0;
switch (listindex)
{

case "Allergy and Immunology" :
document.formname.subcategory.options[0]=new Option("John Smith");

break;

case "OBGYN" :
document.formname.subcategory.options[0]=new Option("Mark Johnson","Mark Johnson");
document.formname.subcategory.options[1]=new Option("Neil Young","Neil Young");


break;

...

And so forth

Each "case" would be a new category and each of the options would be a speciality (listed as subcategory in the DB) of the doctor.

Any code for this?  I think all I really need is the SQL statement and I can take it from there.
ASKER CERTIFIED SOLUTION
Avatar of Proculopsis
Proculopsis

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of freezilla
freezilla

ASKER

Thank you.