DaveyCrockett
Programmer
Hello Everyone,
I have a tricky problem here. I am creating a page that dynamically creates 24 combo boxes with a different name for each (ie.. 11~100~10~10~2,12~200~21~50~2,etc...)
What that means is that I am creating a combo box for each item I want selected. I populate the first number from one table (11) then add the '~' to separate other values retrieved from another table. Below is the sample script.
And it gives me html like this.
<Select Name="cbo11" size="1" ONCHANGE="HandleChange();">
<option value=70~0~0~0~0>Select An Item…</option>
<option value=15~220~25~18~7>Chocolate Bar</option>
</Select>
What I want to do is parse through in the "HandleChange" script to see:
1. Which combo box was selected?
2. What item in the combo box was selected (first set of digits to the left of the '~')
3. What is the 2nd, 3rd, 4th and 5th numeric values in the "value" attribute of the combo box selected.
With this information, I want it to populate a table to the right of the combo box with these values parsed out.
Is this possible with Javascript? Or should I start learning asp.net? I think it might be able to, but am unsure.. any help would be appreciated.
Thank you all in advance.
I have a tricky problem here. I am creating a page that dynamically creates 24 combo boxes with a different name for each (ie.. 11~100~10~10~2,12~200~21~50~2,etc...)
What that means is that I am creating a combo box for each item I want selected. I populate the first number from one table (11) then add the '~' to separate other values retrieved from another table. Below is the sample script.
Code:
<Select Name="cbo<%= rsMeals("MENUM") & rsMeals("MEItem") %>" size="1" ONCHANGE="HandleChange();">
<% rsItems.MoveFirst
While Not rsItems.EOF Response.Write "<option value=" & rsItems("FDID") & "~" & _
rsItems("FDCalories") & "~" & rsItems("FDProteins") & "~" & _ rsItems("FDCarbs") & "~" & rsItems("FDFats") & ">" & rsItems("FDName") & _ "</option>"
rsItems.MoveNext
Wend
%>
</Select>
And it gives me html like this.
<Select Name="cbo11" size="1" ONCHANGE="HandleChange();">
<option value=70~0~0~0~0>Select An Item…</option>
<option value=15~220~25~18~7>Chocolate Bar</option>
</Select>
What I want to do is parse through in the "HandleChange" script to see:
1. Which combo box was selected?
2. What item in the combo box was selected (first set of digits to the left of the '~')
3. What is the 2nd, 3rd, 4th and 5th numeric values in the "value" attribute of the combo box selected.
With this information, I want it to populate a table to the right of the combo box with these values parsed out.
Is this possible with Javascript? Or should I start learning asp.net? I think it might be able to, but am unsure.. any help would be appreciated.
Thank you all in advance.