Can someone help? This code works perfectly in setting the values on a website using the older webbrowser in VB.NET. I am attempting to move to the WebView2 and cannot figure out the magic Javascript to make it work. Can someone please help? Thank you in advance.
NOTE: records_array(z)(4) and others are just dates in an array, in this format “06/01/2024”
Dim inputs As HtmlElementCollection = webBrowser1.Document.GetElementsByTagName("input")
For Each input As HtmlElement In inputs
If Not IsNothing(input) Then
If input.GetAttribute("data-ig") = "x:939876968.0:mkr:3" Then
input.InvokeMember("focus")
input.SetAttribute("value", format_CHD_date(records_array(z)(6)))
add_to_log(log_window, "Passing Admit Date value to site = " & format_CHD_date(records_array(z)(6)))
Application.DoEvents()
End If
If input.GetAttribute("data-ig") = "x:136274528.0:mkr:3" Then
input.InvokeMember("focus")
input.SetAttribute("value", format_CHD_date(records_array(z)(7)))
add_to_log(log_window, "Passing Discharge Date value to site = " & format_CHD_date(records_array(z)(7)))
Application.DoEvents()
End If
If input.GetAttribute("data-ig") = "x:101172535.0:mkr:3" Then
input.InvokeMember("focus")
input.SetAttribute("value", format_CHD_date(records_array(z)(4)))
add_to_log(log_window, "Passing DOB value to site = " & format_CHD_date(records_array(z)(4)))
Application.DoEvents()
End If
End If
Next