Sign in to follow this  
Followers 0
d0n

Radio buttons

7 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

my code doesn't seem to click the 3rd button at all

i tried using yours, but no difference, doesn't select the 3rd radio button

Share this post


Link to post
Share on other sites

been playing around still donno why it wont select the 3rd radio button :P

help anyone?

Share this post


Link to post
Share on other sites

bump?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

o thanks got it now :P

Share this post


Link to post
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
Sign in to follow this  
Followers 0