Jump to content
Sign in to follow this  
ThomasQ

Problem Submitting Form in IE

Recommended Posts

ThomasQ

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!!

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
ThomasQ

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!

Share this post


Link to post
Share on other sites
ThomasQ

Using _IEAction ($oCancelButton, "click" ) now, Works like a charm!

Share this post


Link to post
Share on other sites
PsaltyDS

Using _IEAction ($oCancelButton, "click" ) now, Works like a charm!

Don't-cha feel edu-mah-cated now!

>_<


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

Share this post


Link to post
Share on other sites
Valuater

Don't-cha feel edu-mah-cated now!

>_<

That's a Posted Image for you Salty!!

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  

×