Jump to content

can't click a button with javascript code


warren
 Share

Recommended Posts

Hi:

I am new to this forum,and also a newbie to the autoit.my problem is

I can't click a button to enter a website,the website's source code is below:

<input type="button" class="button" value="Cancel Purchase &gt; &gt;" onclick="locationjump('act=paysubs&amp;nocp=1&amp;CODE=cancel');" />

my autoit code is below:

$oInputs = _IETagNameGetCollection($oIE,"input")

For $oInput In $oInputs

if $oInput.value = "Cancel Purchase > > " Then

_IEAction($oInput,"click")

ExitLoop

EndIf

Next

but the click doesn't work,what mistake I make?please help me,thanks in advance

Edited by warren
Link to comment
Share on other sites

Hi:

I am new to this forum,and also a newbie to the autoit.my problem is

I can't click a button to enter a website,the website's source code is below:

<input type="button" class="button" value="Cancel Purchase &gt; &gt;" onclick="locationjump('act=paysubs&amp;nocp=1&amp;CODE=cancel');" />

my autoit code is below:

$oInputs = _IETagNameGetCollection($oIE,"input")

For $oInput In $oInputs

if $oInput.value = "Cancel Purchase > > " Then

_IEAction($oInput,"click")

ExitLoop

EndIf

Next

but the click doesn't work,what mistake I make?please help me,thanks in advance

Did you try it without translating the "&gt" strings:
if  $oInput.value = "Cancel Purchase &gt; &gt;" Then

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thank you for reply

I run it under SCITE with debug mode on,so I see the _IEAction is actually run.but doesn't work.

Use Example 2 from the help file under _IEAction(), where it gives focus to the element and then sends "{ENTER}" to it instead.

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...