Jump to content

JavaScript OnClick link / click / form submit


Recommended Posts

<a class="selection" href="javascript:submitLink('ReviewActivitiesForm','selectActivity','0')" onclick="return submitLink('ReviewActivitiesForm','selectActivity','0');">
                                        Level_1_Submit_1 </a>

Hi,

I tried to go and read many variants how to simulate click on such source code above (it's table with link which is called via JavaScript), but I can't make it work at all.

Can please someone put me in to right direction ?

Thank you.

$oForm = _IEFormGetObjByName($oIE, "ReviewActivitiesForm")
$oInput = _IEGetObjById($oForm, "selectActivity")
_IEAction ($oInput, "click")

 

Link to comment
Share on other sites

Thanks, but on my example you can see I'm using already ie.au3 - or you mean something else ?

 

Actually is is hidden within a table :

<td headers="3"
id="review_act">
<a class="selection" href="javascript:submitLink('ReviewActivitiesForm','selectActivity','0')" onclick="return submitLink('ReviewActivitiesForm','selectActivity','0');">
                                        Level_1_Submit_1 </a>

I'm trying without success different combos...

$oLink = _IEGetObjByName($oIE, "review_act")
_IEAction ($oLink, "click")
_IELinkClickByText($oLink, "Level_1_Submit_1")

 

Edited by sharkys
Link to comment
Share on other sites

Got it using example from https://www.autoitscript.com/forum/topic/115049-clicking-java-link-in-ie/

 

$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
For $i=0 to ($iNumLinks - 1)
    $oLink = _IELinkGetCollection($oIE,$i)
    ;_IEPropertySet($oLink, "innertext", "BANG!")
    If $oLink.href = "javascript:submitTableLink('ReviewActivitiesForm','selectActivity','0')" Then
        _IELinkClickByIndex($oIE,$i )
        Exit
        EndIf

Next

 

Edited by sharkys
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...