I've spent the better part of today googling dynamic select boxes and read a lot of ways to create them. However, none of the articles I've read address the lists being data driven.
So, here's what I've done and am trying to do. I start with a recordset and convert it into an array using .getrows
The array has 4 elements; ID, drug name, a delimited string of possible dosages, and a delimited string of possible quantities. The parent select is created like this:
What I'm trying to do is create 2 child selects; one for dosage, the other for quantity using the avalible values in the delimited strings in the array.
I have no idea if this is the right way to do this, but I want to keep form submission and database hits to a minimum.
Any suggestions?
So, here's what I've done and am trying to do. I start with a recordset and convert it into an array using .getrows
The array has 4 elements; ID, drug name, a delimited string of possible dosages, and a delimited string of possible quantities. The parent select is created like this:
Code:
<select name = drug onchange=fnDosage(this.options[options.selectedIndex].value,<%=arrDrug%>);>
<option value=choose selected>..Choose..</option>
<%
for i = 0 to ubound(arrDrug,2)
drug_id = arrDrug(0,i)
drug=arrDrug(1,i)
if hist1 = drug_id then
selected = "Selected"
end if
response.Write("<option value="& i & selected & ">" & drug &"</option>")
next
%>
What I'm trying to do is create 2 child selects; one for dosage, the other for quantity using the avalible values in the delimited strings in the array.
I have no idea if this is the right way to do this, but I want to keep form submission and database hits to a minimum.
Any suggestions?