Jump to content

IE Radio Button Problem


Recommended Posts

I am having difficulties selecting a particular radio button on a website for a script I have been writing. I select various other radio buttons with no problems, however no matter what I try I cannot seem to select the first radio button. Can anyone please provide some incite into why this is not working.

Here is a snippet of the html code I cannot select

<html>

                     
<form name="formName" method="post" action="/test/results">


Please check the following radio button to continue<BR>                                    
<INPUT type=RADIO name="Layer1" value="abc" ><BR>
OK<BR>

</html>

This is how I believe the _IEFormElementRadioSelect function is supposed to work.

#include<IE.au3>
    
    $oIE = _IECreate(@ScriptDir & "\example2.html")
    $o_form = _IEFormGetObjByName ($oIE, "formName")
    _IEFormElementRadioSelect($o_form,"abc","Layer1",1,"byValue")
Link to comment
Share on other sites

  • Moderators

This is a known bug, but you can work around it like this.

#include <IE.au3>

$oIE = _IECreate(@ScriptDir & "\example2.html")
$oForm = _IEFormGetObjByName($oIE, "formName")
$oRadio = _IEFormElementGetObjByName($oForm, "Layer1")
If Not $oRadio.checked Then
    With $oRadio
        .checked = True
        .fireEvent ("onchange")
        .fireEvent ("onclick")
    EndWith
EndIf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...