Jump to content
Sign in to follow this  
ghareeb

Access one of submit Button

Recommended Posts

Hi All :(

i used this code to access and automate my object:

With $ObjIE.document.forms(1)
.elements(0).value = "*****"
.elements(1).value = "*****"
.submit.click()

my question is : if i have more than one submit Button how can i access one of them or how can i choose specific button to click?

Thank you! :(


Are you read anything about islamok.... to know about realy Islamhttp://www.islam-guide.com click here====>Islam: Misunderstood throughout the World

Share this post


Link to post
Share on other sites

use "autoit window information"

same location as autoit.exe

then use **********

ControlCommand ( "title", "text", controlID, "command", "option" )

or ********

ControlClick ( "title", "text", controlID [, button] [, clicks]] )

hope it helps


NEWHeader1.png

Share this post


Link to post
Share on other sites

A few ways, control command and control click don't work in IE though.

Look at the HTML of that page, usually there is a more specific name.

With $ObjIE.document.forms(1)
.elements(0).value = "*****"
.elements(1).value = "*****"
.submitbt.click(); this would be if button had a name of submitbt

also you might find that the button doesn't actually have a name (sloppy html.) in that case you can search elements, or HREFs.

With $ObjIE.document.forms(1)
.elements(0).value = "*****"
.elements(1).value = "*****"
endwith
$x= $ObjIE.document.forms(1).elements().length
for $i = 0 to $x
if stringinstr($ObjIE.document.forms(1).elements($i).outerHTML,"click to continue" )>0 then exitloop
next
$ObjIE.document.forms(1).elements($i).click()

From memory, so might have a .document missing in there or something.

You can also use this technique for HTML links, it works exceptionally good for javascript and frame links. (due to the fact that they change multiple frames and can't just be pasted in, or do page checks and such.)

I will be posting some more UDFs for IE and the obj soon. (appearing in scraps soon)

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...