Have been working through some DHTML examples.
One of the examples propogates values to a list box on the selection of a select box. That works fine. I was thinking of taking it to another level based apon what is selected in the list box it will add data to a text box. Does anyone know what I should be ading to the code to do this? Also does anyone know a good in depth site for DHTML?
Code is as follows
Private Sub AddElement(lstlist As Object, strtext As String)
Dim hoeoption As HTMLObjectElement
Set hoeoption = Document.createElement("OPTION"
hoeoption.Text = strtext
lstlist.Add hoeoption
Set hoeoption = Nothing
End Sub
Private Sub basewindow_onload()
Call cmbgroup_onchange
End Sub
Private Sub cmbgroup_onchange()
Do While LstGroup.length > 0
LstGroup.Remove 0
Loop
Select Case cmbgroup.Value
Case "Fruits"
AddElement LstGroup, "Apples"
AddElement LstGroup, "Oranges"
AddElement LstGroup, "Pears"
AddElement LstGroup, "Plum"
Case "Vegtables"
AddElement LstGroup, "lettuce"
AddElement LstGroup, "Carrots"
AddElement LstGroup, "beans"
AddElement LstGroup, "peas:"
Case "Birds"
AddElement LstGroup, "Robin"
AddElement LstGroup, "Hawk"
AddElement LstGroup, "Finch"
End Select
End Sub
Private Function LstGroup_onclick() As Boolean
If LstGroup.Value = "OPTION" Then
MsgBox "hi"
End If
End Function
One of the examples propogates values to a list box on the selection of a select box. That works fine. I was thinking of taking it to another level based apon what is selected in the list box it will add data to a text box. Does anyone know what I should be ading to the code to do this? Also does anyone know a good in depth site for DHTML?
Code is as follows
Private Sub AddElement(lstlist As Object, strtext As String)
Dim hoeoption As HTMLObjectElement
Set hoeoption = Document.createElement("OPTION"
hoeoption.Text = strtext
lstlist.Add hoeoption
Set hoeoption = Nothing
End Sub
Private Sub basewindow_onload()
Call cmbgroup_onchange
End Sub
Private Sub cmbgroup_onchange()
Do While LstGroup.length > 0
LstGroup.Remove 0
Loop
Select Case cmbgroup.Value
Case "Fruits"
AddElement LstGroup, "Apples"
AddElement LstGroup, "Oranges"
AddElement LstGroup, "Pears"
AddElement LstGroup, "Plum"
Case "Vegtables"
AddElement LstGroup, "lettuce"
AddElement LstGroup, "Carrots"
AddElement LstGroup, "beans"
AddElement LstGroup, "peas:"
Case "Birds"
AddElement LstGroup, "Robin"
AddElement LstGroup, "Hawk"
AddElement LstGroup, "Finch"
End Select
End Sub
Private Function LstGroup_onclick() As Boolean
If LstGroup.Value = "OPTION" Then
MsgBox "hi"
End If
End Function