Sign in to follow this  
Followers 0
klaki

IE.au3: Clicking button based on button value

4 posts in this topic

There is a form that has no name and looks like:

<FORM>

*insert various combo boxes and such*

<INPUT TYPE="button" onclick="some javascript" VALUE="Result 1">

</FORM>

The value of the button will change based on results of a previous form. My question is there a way to attach to this button and click it using IE.au3 and not using MouseClick?

Thanks in advance,

Klaki

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

here is an example

#include <IE.au3>

#Region --- IE-Builder generated code Start ---
Dim $oIE
$sUrl = "http://www.darkthrone.com/login.dt"

$oIE = _IECreate ()
_IENavigate ($oIE, $sUrl)

Sleep(1000)

$SubmitButtonSource = "templates/notloggedin/images/buttons/submit.gif"
$oInputs = _IETagNameGetCollection (_IEDocumentGetObj ($oIE), "input")
For $oInput In $oInputs
    If $oInput.src <> "" And StringInStr ($oInput.src, $SubmitButtonSource, 0) Then
        $oInput.click
        ExitLoop
    EndIf
Next

#EndRegion --- IE-Builder generated code End ---

You obviously have the IE.au3 Library

You should get the IE.au3 Builder also... it has the example page you can copy into the builder to test

http://www.autoitscript.com/forum/index.ph...68&hl=Valuater#

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

here is an example

#include <IE.au3>

#Region --- IE-Builder generated code Start ---
Dim $oIE
$sUrl = "http://www.darkthrone.com/login.dt"

$oIE = _IECreate ()
_IENavigate ($oIE, $sUrl)

Sleep(1000)

$SubmitButtonSource = "templates/notloggedin/images/buttons/submit.gif"
$oInputs = _IETagNameGetCollection (_IEDocumentGetObj ($oIE), "input")
For $oInput In $oInputs
    If $oInput.src <> "" And StringInStr ($oInput.src, $SubmitButtonSource, 0) Then
        $oInput.click
        ExitLoop
    EndIf
Next

#EndRegion --- IE-Builder generated code End ---

You obviously have the IE.au3 Library

You should get the IE.au3 Builder also... it has the example page you can copy into the builder to test

http://www.autoitscript.com/forum/index.ph...68&hl=Valuater#

8)

That example worked great. Thanks a lot, I got it working the way I want. Thanks again, V

Share this post


Link to post
Share on other sites

That example worked great. Thanks a lot, I got it working the way I want. Thanks again, V

Welcome...

8)


NEWHeader1.png

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