Fire event with vba & InternetExplorer.Application to recalculate jquery form

爷,独闯天下 提交于 2019-12-03 20:54:55
user2929630

Thanks for your Help

Now i have the solution:

ie.Document.getElementById("Article__").Click
ie.Document.getElementById("Article_ArticleDetails_").Focus
ie.Document.getElementById("Article_ArticleDetails_").Value = "9"

'This will run the java script / fire the recalc event
ie.Document.parentWindow.execScript "registrationUpdate()", "JavaScript"

Thanks all.

For the link provided the form has disabled dropdown but it has the options element in it so you may set disabled as false and can do further processing. (The dropdown are not waiting for ajax request to get filled)

Sub test_fill_form()

Dim url1 As String
Dim url2 As String
Dim url3 As String

url1 = "https://auto."
url2 = "ar"
url3 = "do.ch/selling/?step=1&uniqueid=8a7d2327-f426-4df7-8291-d6b55fc62e3c"

Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")

ie.Visible = True
'apiShowWindow ie.Hwnd, SW_MAXIMIZE
ie.navigate url1 & "ric" & url2 & url3

While ie.readyState <> 4: DoEvents: Wend

ie.document.all("Article_ArticleDetails_AutoRegistrationMonth").Click
ie.document.getElementById("Article_ArticleDetails_AutoRegistrationMonth").Value = "1"
ie.document.getElementById("Article_ArticleDetails_AutoRegistrationYear").Value = "2013"
ie.document.getElementById("Article_ArticleDetails_AutoMakeId").disabled = False
ie.document.getElementById("Article_ArticleDetails_AutoModelId").disabled = False
ie.document.getElementById("Article_ArticleDetails_AutoFuel").disabled = False
End Sub
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!