1
Guys I got a field:
I set to automatically fill in VB
:
Me.WebBrowser1.Document.GetElementsByTagName("select").GetElementsByName("NW_State").Item(0).SetAttribute("value", "AK")
But it’s not going at all, I’ve tried so many ways.
1
Guys I got a field:
I set to automatically fill in VB
:
Me.WebBrowser1.Document.GetElementsByTagName("select").GetElementsByName("NW_State").Item(0).SetAttribute("value", "AK")
But it’s not going at all, I’ve tried so many ways.
0
You can retrieve the children’s items from select
and iterate for them by selecting the one who has the text sought:
Dim htmlElm As HtmlElement = Me.WebBrowser1.Document.GetElementsByTagName("select").GetElementsByName("NW_State").Item(0)
For Each item As HtmlElement In htmlElm.Children
If (item.InnerHtml = "AZ") Then
item.SetAttribute("selected", "selected")
Else
item.SetAttribute("selected", String.Empty)
End If
Next
Browser other questions tagged html vb.net
You are not signed in. Login or sign up in order to post.