Jump to content
Sign in to follow this  
eyegeegeewhy

finding a button to click with no name

Recommended Posts

eyegeegeewhy

Hi

I am trying to use the _IEAction to click a button a a page but i dont know how to find the botton to click as when i look at the page source i only have this

<INPUT TYPE="button" onclick="bulletsDefaultValues()" VALUE="Bullet defaults">

I was expecting a name or id .

Any suggestions

Share this post


Link to post
Share on other sites
PsaltyDS

Hi

I am trying to use the _IEAction to click a button a a page but i dont know how to find the botton to click as when i look at the page source i only have this

<INPUT TYPE="button" onclick="bulletsDefaultValues()" VALUE="Bullet defaults">

I was expecting a name or id .

Any suggestions

Get the collection of all form elements with _IEFormElementGetCollection(), or just all input tags with _IETagNameGetCollection(). Then loop through the collection looking for $oElement.value = "Bullet defaults".

^_^


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
eyegeegeewhy

Get the collection of all form elements with _IEFormElementGetCollection(), or just all input tags with _IETagNameGetCollection(). Then loop through the collection looking for $oElement.value = "Bullet defaults".

^_^

Hi

Im sorry to be a pain but could do you have an example of this. Im looking through the help file but struggling to get it to work.

Cheers

Share this post


Link to post
Share on other sites
eyegeegeewhy

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

For $i in $oForm

_IEaction($i,'click')

Next

I have tried the above and it does click on everything. How do i change this to just click the item i want.

Edited by eyegeegeewhy

Share this post


Link to post
Share on other sites
PsaltyDS

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

For $i in $oForm

_IEaction($i,'click')

Next

I have tried the above and it does click on everything. How do i change this to just click the item i want.

I don't see how it clicked on anything at all, since _IEformGetObjByName() only returns form objects, not the form elements.

Anyway, this is what I meant:

$oForm = _IEFormGetObjByName ($oIE, "yellform")
$colInputs = _IETagNameGetCollection($oForm, "input")
For $oInput in $colInputs
    If String($oInput.value) = "Bullet defaults" Then
        _IEAction($oInput, "click")
        ExitLoop
    EndIf
Next

^_^


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
eyegeegeewhy

I don't see how it clicked on anything at all, since _IEformGetObjByName() only returns form objects, not the form elements.

Anyway, this is what I meant:

$oForm = _IEFormGetObjByName ($oIE, "yellform")
$colInputs = _IETagNameGetCollection($oForm, "input")
For $oInput in $colInputs
    If String($oInput.value) = "Bullet defaults" Then
        _IEAction($oInput, "click")
        ExitLoop
    EndIf
Next

^_^

Hi Thankyou.

This is the best i came up with

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

For $i in $oForm

if $i.value = "Bullet defaults" then

_IEaction($i,"click")

EndIf

Next

Which i think is what you are doing but yours is just tidier.

Thankyou for your help!!!

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  

×