View Full Version : VBA IE Javascript Radio Select

03-10-2011, 09:34 PM
Hi Guys,

I am having a little trouble selecting a radio button on a webpage that has...alot of javascript fuctions. On a normal webpage I would execute the following codes:
IE.document.getElementById("selectedvariable")(11011).Checked = True

or the following:
Set radio_button = IE.document.all.Item("SelectedVariable")
For Each rb In radio_button
If rb.Value = "808725" Then
rb.Checked = True
End If

Lately I have been using a point and click program to help me identify form names, tag names, and values quicker. The program has genereate the following vb.net string which selects the radio button:

scene.HtmlInputRadioButton("TargetSelected").Invoke("Click", ControlActionType.InvokeMethod, "Target -2644426-2644366")

The HTML source code that I can find:
input name="TargetSelected" *******="setSelectedTarget(this)" type="radio" value="Target-2644426-2644366"/>

The website has a bunch of information that I have to fill in. The Radio button comes from a pop up window( it is not a new browser window just a script window that populate with data from the parent tree. kind of hard to explain) <---- haha idk what im talking about. the pop window is executed by the following code:

Call IE.document.parentWindow.execScript("openSearchWindow('search')")

I have tried both of my methods listed above and both have failed.
I am having a little difficulting following all of the html but If I can provide any additional script please let me know.
I am open to any and all suggestion. Thanks again in advance.

03-11-2011, 11:35 AM
The **** in the html is an onclick code .... onclick ="setSelectedTarget(this)"