Jump to content
Sign in to follow this  
wisem2540

Need to tick a checkbox in IE

Recommended Posts

wisem2540

So i took a look at some of the IE functions, and I do not understand them. What I am trying to do is install a plugin from a website. (an intranet site)

I looked at the Sourcecode in the browser and it looks like the control is name CBXMAIN. So first i tried launching the site with CBXMAIN=1 on the end, and of course that did not work. (it works if i do loginname= for the username)

if there is a way to put it in the URL so I dont have to script it, great. Otherwise, I guess i need to know how to click the box. Can someone point me in the right direction. I am not a programmer, so simplicity is key

thanks

Share this post


Link to post
Share on other sites
Aipion

You will have to look at _IEFormElementCheckBoxSelect function.

Share this post


Link to post
Share on other sites
wisem2540

You will have to look at _IEFormElementCheckBoxSelect function.

Well thats a start. Thank you. The example in the help file still means nothing to me. I dont understand any of it.

#include ie.au3 - what is this even for?

and the rest are just a bunch of variables with no indication as to how to apply them in the real world

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, wisern2540. You need to read through the Help file if you hope to gain a sense of why things do what they do in AutoIT. Also, if you would like to help us help you, how about a little more information? Can you include the URL you're trying to get to, and which checkbox exactly (screenshot?) you're trying to check?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
somdcomputerguy

#include

In this case, the file ie.au3 contains the IE functions that can be called in a user's script.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
wisem2540

Hi, wisern2540. You need to read through the Help file if you hope to gain a sense of why things do what they do in AutoIT. Also, if you would like to help us help you, how about a little more information? Can you include the URL you're trying to get to, and which checkbox exactly (screenshot?) you're trying to check?

As i said before, it is an internal website.

Here is a copy of part of the source code that I believe deals with this pariticular page

</tr>

<tr>

<td colspan="2" style="padding:1px; font-family: Century Gothic,Arial,Helvetica; color:FFFFFF; font-size: 20px; line-height: 20px;"><div align="center">

<input name="logon" type="button" value="Sign In" onclick=browserLogin()>

<img src="/images/lock.gif"><br><input type=checkbox name=cbxMainMenu value=1><font name='Century Gothic' size=2>Go to Main Menu upon Sign In</font></div></td>

</tr>

<tr>

<td colspan="2" style="padding:4px; font-family: Century Gothic,Arial,Helvetica; color:FFFFFF; font-size: 11px; line-height: 13px;">

</tr>

along with a screenshot. I hope this is some more help

thanks

post-70391-0-24963000-1330378480_thumb.j

Share this post


Link to post
Share on other sites
Aipion

As i said before, it is an internal website. Here is a copy of part of the source code that I believe deals with this pariticular page

/images/lock.gif

Go to Main Menu upon Sign In

along with a screenshot. I hope this is some more help thanks

Can you give me the full line from the sorce where it has the <form tag.

Share this post


Link to post
Share on other sites
wisem2540

Can you give me the full line from the sorce where it has the <form tag.

this?

<form name="login" method="post" action="http://10.36.202.172/cgi-bin/prbrowser.cgi#top_page" AUTOCOMPLETE=OFF>

I have also attached the source txt...well i tried but it failed....

Share this post


Link to post
Share on other sites
Aipion

this?

<form name="login" method="post" action="http://10.36.202.172/cgi-bin/prbrowser.cgi#top_page" AUTOCOMPLETE=OFF>

I have also attached the source txt...well i tried but it failed....

yes

try the below code.

#include <IE.au3>
; Create a browser window and navigate to the login webpage
$oIE = _IECreate(""); <<<<<<<<<<<< add Url in "" of the login webpage
; get pointers to the login form
Local $o_form = _IEFormGetObjByName($oIE, "login")
; select the checkbox
_IEFormElementCheckBoxSelect($o_form, 1, "cbxMainMenu", 1, "byValue")
Edited by Aipion

Share this post


Link to post
Share on other sites
wisem2540

yes

try the below code.

#include <IE.au3>
; Create a browser window and navigate to the login webpage
$oIE = _IECreate(""); <<<<<<<<<<<< add Url in "" of the login webpage
; get pointers to the login form
Local $o_form = _IEFormGetObjByName($oIE, "login")
; select the checkbox
_IEFormElementCheckBoxSelect($o_form, 1, "cbxMainMenu", 1, "byValue")

Yes it worked....

So I was on the right track with CBXmainmenu=1. But i guess i was missing the pointers? Can you explain so that I may learn from this?

Share this post


Link to post
Share on other sites
Aipion

Local $o_form = _IEFormGetObjByName($oIE, "login")

Where it says "login" that came from <form name="login" so we know what form to target.

_IEFormElementCheckBoxSelect($o_form, 1, "cbxMainMenu", 1, "byValue")

i used the method of "byValue" in this function, value=1 since it was in the source of the tag <img src="/images/lock.gif"><br><input type=checkbox name=cbxMainMenu value=1> this used to identify what check to work with.

the second 1 in the function is to Check the Check-box.

Edited by Aipion

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  

×