Jump to content

IE Click on button by Value


Recommended Posts

Hello, i need your help again. How click on button in form if buttons have same name ? Button value is different. 

My script not working

func odoslat()
Local $oForm = _IEFormGetObjByName($oIE, "formedit")
Local $oSelect = _IEFormElementGetObjByName($oForm, "Zmazať")
_IEAction($oSelect, "focus")
_IEAction($oSelect, "click")
EndFunc

Source code from web is here: I need click on button "Zmazať"

<form name="formedit" id="formedit" method="post"  action="/deletei2.php">
<br>
Vaše heslo:<br> <input type="text" name="heslobazar" maxlength="20" value=""><br><br>
<input type="hidden" name="idad" id="idad" value=49359062>
<input type="submit" name="administrace" value="Editovať"> <input type="submit" name="administrace" value="Zmazať">
</form>
</td>
</tr>

Thanks for answer

Edited by zemkor
Link to comment
Share on other sites

See if this works (don't know how should I test this xD), I only used IE udf one or three times...and I hate it

$oButtons = _IEGetObjByName($oForm,"administrace",-1)
For $oBtn In $oButtons
    If _IEFormElementGetValue($oBtn) = "Zmazat" Then
        _IEAction($oBtn, "focus")
        _IEAction($oBtn, "click")
        ExitLoop
    EndIf
Next
Edited by Kyan

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

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

×
×
  • Create New...