eyegeegeewhy Posted April 27, 2009 Share Posted April 27, 2009 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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 27, 2009 Share Posted April 27, 2009 HiI 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 suggestionsGet 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 Link to comment Share on other sites More sharing options...
eyegeegeewhy Posted April 27, 2009 Author Share Posted April 27, 2009 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". HiIm 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 Link to comment Share on other sites More sharing options...
eyegeegeewhy Posted April 27, 2009 Author Share Posted April 27, 2009 (edited) $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 April 27, 2009 by eyegeegeewhy Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 27, 2009 Share Posted April 27, 2009 $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 Link to comment Share on other sites More sharing options...
eyegeegeewhy Posted April 27, 2009 Author Share Posted April 27, 2009 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!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now