Sign in to follow this  
Followers 0
jimmyjmmy

how to uncheck checkbox

2 posts in this topic

Hi,

I wish to uncheck a checkbox in gmail.com and so I read the helpfiles.

Looking at the helpfile example below, can someone tell me how to get the 'f' inside _IEFormGetObjByName?

I have installed IE Developer toolbar. I know how to get the "q" for IEFormElementGetObjByName.

Thanks

#include <IE.au3>

$oIE = _IECreate ("http://www.google.com")

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

$oQuery = _IEFormElementGetObjByName ($oForm, "q")

_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")

_IEFormSubmit ($oForm

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

try something like this

#include<IE.au3>

$url = 'http://www.useit.com/alertbox/20040927.html' ; just an example you can change this to the website URL
$checkbox = 'permission' ; just an example, change this to the ID of the checkbox

$ie = _IECreate(); creates IE
_IENavigate($ie,$url); navigates to the URL
$obj_checkbox = _IEGetObjByName($ie,$checkbox); gets the checkbox by its name
_IEAction($obj_checkbox,'click');clicks on the checkbox (checks it)
sleep(2000) ; sleeps for 2 seconds
_IEAction($obj_checkbox,'click');clicks on the checkbox again(unchecks it)
sleep(2000) ; sleeps for 2 seconds
_IEAction($obj_checkbox,'click');clicks on the checkbox (checks it again)

not tested but should work :P

Edited by DexterMorgan

code

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  
Followers 0