Jump to content

Recommended Posts

Posted

Hi!

I'm trying to click these buttons on a website;

</fieldset><input class="inputright" value="Publishn" name="_publish" type="submit"/><input value="Cancel" name="_cancel" type="submit"/><input value="Save" name="_save" type="submit"/></form></div>

I'm trying this

$oForm = _IEFormGetObjByName ($oIE, "_cancel")

_IEFormSubmit ($oForm)

&

$oForm = _IEFormGetObjByName ($oIE, "cancel")

_IEFormSubmit ($oForm)

but _IEFormGetObjByName keeps returning this --> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch..

When filling in the form were the buttons are for, I'm using the form id="advert" in the _IEFormGetObjByName ($oIE, "advert") command, wich works, but that way, I won't be able to choose between Save, Cancel and Publish..

Any one any idea how I'm able to click the different buttons?

Thanks!!

Posted

I'm trying this

$oForm = _IEFormGetObjByName ($oIE, "_cancel")

_IEFormSubmit ($oForm)

&

$oForm = _IEFormGetObjByName ($oIE, "cancel")

_IEFormSubmit ($oForm)

but _IEFormGetObjByName keeps returning this --> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch..

When filling in the form were the buttons are for, I'm using the form id="advert" in the _IEFormGetObjByName ($oIE, "advert") command, wich works, but that way, I won't be able to choose between Save, Cancel and Publish..

Any one any idea how I'm able to click the different buttons?

Thanks!!

Only use _IEFormGetObjByName() to get the FORM object. To get the object for an element in the form use _IEFormElementGetObjByName(). For example:
$oForm = _IEFormGetObjByName($oIE, "advert")
$oCancelButton = _IEFormElementGetObjByName($oForm, "_cancel")

>_<

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
Posted

Thanks! It Still doesn't work though..

$oForm = _IEFormGetObjByName ($oIE, "advert")

$oCancelButton = _IEFormElementGetObjByName($oForm, "_cancel")

ConsoleWrite($oCancelButton & @CRLF)

_IEFormSubmit ($oCancelButton)

I get this error: --> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidObjectType

If i change _cancel to something else, it also returns an error on the _IEFormElementGetObjByName command, so _cancel is being recognized.

Anyone any suggestions??

Thanks in advance!

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
×
×
  • Create New...