Sign in to follow this  
Followers 0
SorryButImaNewbie

Unchecking al the checkboxes/radio buttons on a webpage

6 posts in this topic

Hi i found a few >threads about this in the forum but none seems to helped me to much.

I have to uncheck 2 checkboxes on a webpage (noone wants those notification e-mails right? :)

I know that my radiobuttons (I use the 2 terms interchangeably, can i do that?) are in a grp, I assume this since they dont have their own name or something, tried to find somekind of data about them in sourcecode and using F12 toolbar for IE.

i get the 

--> IE.au3 T3.0-1 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType
--> IE.au3 T3.0-1 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType
errors. I guess the 2 line is understandable since _IEFormElementGetObjByName failed so the setvalue gets a -1 or something
 
Ohh my code I tried last is
Local $checkbox248 =  _IEFormElementGetObjByName($Explorer, "jqTransformCheckboxWrapper")
    _IEFormElementSetValue($checkbox248,0)

I only found href link a JQuery12123414 (i think this is the index) with a value of 248 (it didnt work with 248 in the place of jqTransformCheckboxWrapper)

and a class (not working either)

I would be happy with a code that goes over every radiobutton and uncheck them all if you guys have something like that. (Sorry If there is an UDF for that, I just remember that I sweared that i check the UDF wiki before posting, so i start that after posting this) But any idea to solve this is welcome!

 

Share this post


Link to post
Share on other sites



Okey, I found a thread (>thisone) that told me that apperantly radio button and checkboxes arent interchangeable, so sorry for that.

My question was about checkboxes only

Share this post


Link to post
Share on other sites

The first parameter to _IEFormElementGetObjByName should be an object reference to a form, not the main IE object.

Look at the entry for _IEFormElementGetObjByName in the help file. Run the example code and use it as a basis for your own.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

And what if the checkbox only has a href and a class? (according to f12 IE developer tool) I couldn't find it in the source code. I webpage leads me through a few pages, and they have the same URL. I dont know but this could be information to you :)

here is the HTML code read/copied from the developer tool:

<span class="readyDatas highlight">
<span class="jqTransformCheckboxWrapper">
<a class="jqTransformCheckbox" href="#"/>
<input name="ctl00$wpm$UserControlPortlet1302082381$ctl00_wpm_UserControlPortlet1302082381_userControlPortlet$cbAdatokHelyesek" class="jqTransformHidden" id="cbAdatokHelyesek" type="checkbox"/>
<label style="cursor: pointer;" for="cbAdatokHelyesek">

also which form should I give it? Doesn't matter as long as the checknox is on that from to?

Edit: the first Next button (after that the URL is the same) onclick event is: javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$wpm$UserControlPortlet1302082381$ctl00_wpm_UserControlPortlet1302082381_userControlPortlet$btnAdatokMegadasa", "", true, "", "", false, false))

Edited by SorryButImaNewbie

Share this post


Link to post
Share on other sites

In my quest to find the form where this checkbox "hide" I now franaticly try to find its form. From the above comment I concluded that this is a "morphing" page caused by javascript, which I'm not familiar with whats so ever. (Feel free to correct my unprofessional language, I know that I can develope that a bit better)

I dont really understand whats the -1 = (Default) returns a collection means in the help file of _IEFormGetCollection. I wanted to write it out to the console but it doesn't show anything can you tell me what do i do wrong? (I guess the collection it returns isnt a string, but I don't know how to transform it in to one)

My code snippet:

Local $oForm2 = _IEFormGetCollection ($oIE)
    ConsoleWrite($oForm2)

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