Jump to content

Radio buttons


d0n
 Share

Recommended Posts

Ok the site here has 3 radio buttons, i just need it to check the last one

<p><table width="100%" class="f10">
<tr><td valign="top" width="33%">
<div class="f10"><input type="Radio" name="c" value="2" checked>Reinforcement</div>
<div class="f10"><input type="Radio" name="c" value="3" >Attack: Normal</div>
<div class="f10"><input type="Radio" name="c" value="4" >Attack: Raid</div>
</td>

This is the part of the code where the buttons are ^

$oForm = _IEFormGetObjByIndex($oIE, 34)
_IEFormElementRadioSelect ($oForm, 2, "c", 1, "byIndex")

Instead of using _IEFormGetObjByIndex, i wanted to use _IEFormGetObjByName but I dont know what

$oForm = _IEFormGetObjByName ($oIE, "~~~~~~~~") the bolded part of this should be

Suggestions and help plz

Link to comment
Share on other sites

So long as the form you want is index 34, your code looks good. Can I ask you to try this instead however:

_IEFormElementRadioSelect ($oForm, 2, "", 1, "byIndex")

There are cases that I think specifying the radioset name is not working. Please let me know your results.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

bump?

Make certain you are running the latest AutoIt production or beta. _IEFormGetObjByIndex has been replaced with _IEFormGetCollection

This code is based on yours and works for me:

#include <IE.au3>
$oIE = _IECreate()
$sHTML = ''
$sHTML &= '<p><table width="100%" class="f10">'
$sHTML &= '<tr><td valign="top" width="33%"><form>'
$sHTML &= '<div class="f10"><input type="Radio" name="c" value="2" checked>Reinforcement</div>'
$sHTML &= '<div class="f10"><input type="Radio" name="c" value="3" >Attack: Normal</div>'
$sHTML &= '<div class="f10"><input type="Radio" name="c" value="4" >Attack: Raid</div>'
$sHTML &= '</form></td>'
_IEBodyWriteHTML($oIE,$sHTML)
$oForm = _IEFormGetCollection($oIE, 0)
_IEFormElementRadioSelect ($oForm, 2, "c", 1, "byIndex")

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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...