I have 3 Dropdown Lists (could be more in future).
DropdownList1 is a parent and is populated from a database.
DropdownList2 is a child and is populated from the selected item from DropdownList1.
DropdownList3 is a child and is populated from the selected item from DropdownList2.
I would like to add the selected item to a ListBox.
The problem i have is DropdownList2 and DropdownList3 may not always have a child item, so to add the items to a ListBox, i could store their IDs but display their text.
My database table has 3 columns to save the value (ID) from the 3 dropdown lists.
My question is if i display the text of the item in the ListBox, the next step is to save the data into the table into the relevant columns (so column 1 would save data from DD1, Column 2 would save from DD2 etc) is there anyway to identify which ID the item belongs to, so i can save the correct ID to the correct column?
So a user selects item 1 from DD1 item 2 from DD2, there is no item available from DD3, so they click add which adds the item to the ListBox. When i have to save this item how could i distinguish the item added was upto DD2 therefore it needs to be added to Column2? Or is there a better approach?
Hope this makes sense
obj[i].val1, obj[i].val2etc to access the values for your query (werei = method to extract array location)myObj object = new myObj(val1, val2, val3)then add it to an array or list