sgn209 Posted December 7, 2013 Share Posted December 7, 2013 Hi Autoit Forum , I want to learn how to click a submit in this case <a class="btn-yellow bby-submitPlaceOrder" onClick="handlePlaceOrder()">Place Order</a> Thanks .. Link to comment Share on other sites More sharing options...
karlkar Posted December 7, 2013 Share Posted December 7, 2013 Actually you don't have to click it. You can just call this function from onClick. $oIe.document.parentWindow.eval("handlePlaceOrder()") Link to comment Share on other sites More sharing options...
sgn209 Posted December 7, 2013 Author Share Posted December 7, 2013 Actually you don't have to click it. You can just call this function from onClick. $oIe.document.parentWindow.eval("handlePlaceOrder()") I got this error when try it: C:\Users\Dat\Desktop\WORK\DAT - POST.au3 (399) : ==> The requested action with this object has failed.: $OIE.document.parentWindow.eval("handlePlaceOrder()") $OIE.document.parentWindow.eval("handlePlaceOrder()")^ ERROR ->03:05:32 AutoIt3.exe ended.rc:1 >Exit code: 1 Time: 23.228 Link to comment Share on other sites More sharing options...
Solution karlkar Posted December 7, 2013 Solution Share Posted December 7, 2013 Are you using ie 10? Try $links = $oIe.document.getElementsByClassName("btn-yellow bby-submitPlaceOrder") For $link In $links $link.click() Next You can of course change this loop if you know which occureance of this link you want to click to $links.item(x).click() Link to comment Share on other sites More sharing options...
sgn209 Posted December 7, 2013 Author Share Posted December 7, 2013 Are you using ie 10? Try $links = $oIe.document.getElementsByClassName("btn-yellow bby-submitPlaceOrder") For $link In $links $link.click() Next You can of course change this loop if you know which occureance of this link you want to click to $links.item(x).click() This one working perfectly ! Thank you very very much ! You are a hero save my life ! 2 more question, i dont know why all of my script CAN'T RUN on Windows Server 2008 with IE 11 ? Where I can find documents to about $oIe.document."something" ? Thanks again and have a great day ! Link to comment Share on other sites More sharing options...
karlkar Posted December 7, 2013 Share Posted December 7, 2013 This "something" are javascript functions. You can read about it on javascript docs or at http://msdn.microsoft.com/en-us/library/ie/ms533738(v=vs.85).aspx Link to comment Share on other sites More sharing options...
bobfii Posted December 8, 2013 Share Posted December 8, 2013 I am trying to do the same thing, press a button on a web page using autoit. The line of code describing the button I am trying to press is shown below: <TR><TD colspan=6 align=center><br><input type="button" value="Copy Your Computer's Time Settings" onclick="CopyTimeFromPC();"></TD></tr> The web page has HTML and embedded javascript. I can see the onclick javascript subroutine in the web page source code. I just don't know how to activate it. All the ieau3 functions seem to need a name or class, this has neither. Any ideas? Link to comment Share on other sites More sharing options...
karlkar Posted December 8, 2013 Share Posted December 8, 2013 You can try either my answer from post #2 or $inputs = $oIE.document.getElementsByTagName("input") For $input In $inputs If $input.value == "Copy Your Computer's Time Settings" then $input.click() EndIf Next Link to comment Share on other sites More sharing options...
bobfii Posted December 9, 2013 Share Posted December 9, 2013 (edited) Thanks for the suggestions. It worked. Edited December 9, 2013 by bobfii 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