ThatGuy
01-30-2009, 09:40 AM
I am trying to fill in a Javascript form and have run into an issue. I have with muliple drop downs. Each drop down's data is based on the selection of the previous drop down.
I am able to fill in the first drop down using the below code. However, it dies not update drop down below it. I tried forcing my value into the second drop down but it errors out.
I cannot post the html code as it contains confidential information and I am not familiar with javascript so I do not know what part would be important and which ones would not be.
Here is my code:
Sub GoToWebSiteUpdate()
Dim appIE As InternetExplorer
Dim sURL As String
Dim UserN As Variant
Dim myLoginID As String
Set appIE = New InternetExplorer
sURL = "mysite"
With appIE
.Navigate sURL 'Go to Login page
.Visible = True 'Show IE
'Enter information in the first drop down
Set UserN = appIE.document.getElementsByName("dropdown1")
UserN(0).Value = "Answer1"
'Enter information in the second drop down
Set UserN = appIE.document.getElementsByName("dropdown2")
UserN(0).Value = "Answer2"
end with
Set appIE = Nothing
End Sub
Any ideas?
I eventually plan on posting my entire code IE Automation to help others who may be trying to fill in advanced forms.
I am able to fill in the first drop down using the below code. However, it dies not update drop down below it. I tried forcing my value into the second drop down but it errors out.
I cannot post the html code as it contains confidential information and I am not familiar with javascript so I do not know what part would be important and which ones would not be.
Here is my code:
Sub GoToWebSiteUpdate()
Dim appIE As InternetExplorer
Dim sURL As String
Dim UserN As Variant
Dim myLoginID As String
Set appIE = New InternetExplorer
sURL = "mysite"
With appIE
.Navigate sURL 'Go to Login page
.Visible = True 'Show IE
'Enter information in the first drop down
Set UserN = appIE.document.getElementsByName("dropdown1")
UserN(0).Value = "Answer1"
'Enter information in the second drop down
Set UserN = appIE.document.getElementsByName("dropdown2")
UserN(0).Value = "Answer2"
end with
Set appIE = Nothing
End Sub
Any ideas?
I eventually plan on posting my entire code IE Automation to help others who may be trying to fill in advanced forms.