Jump to content

Need to tick a checkbox in IE


 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

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?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 Guest
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 Guest
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...