I have a listbox (listBox) and a dropdown list(dropDown). I want to be able to select an item from the dropDown and add them to the listBox. I have looked everywhere for this but all I ever see is adding data from a datasource instead of a dropdown. I want this to be dynamic so the listBox is populated based on the a user selected in the dropDown. The code I have is:
Sub btnGo_OnClick(eventObj)
dim field1 as XPathNavigator = xDocument.DOM.selectNodes("//my:listbox")
dim newNode as XPathNavigator = field1.Clone()
set objXMLNodes = XDocument.DOM.selectNodes("//my:myFields")
mytext = XDocument.DOM.selectSingleNode("//my:dropDown").text
temp = msgbox(mytext, vbok) 'so I can see, yes I am getting data from the dropdown to add to the listbox
newNode.SelectSingleNode("value").SetValue(mytext)
newNode.SelectSingleNode("displayname").SetValue(mytext)
field1.appendchild(newNode)
End Sub