cypher175 Posted April 8, 2009 Posted April 8, 2009 Is there anyway to check the status/state of a checkbox in a webpage to see if its ticked or unticked..??
Authenticity Posted April 8, 2009 Posted April 8, 2009 Get an object reference to the checkbox and use it's checked property as: Dim $fChecked = $oCheck.Checked ; Return true if checked, false otherwise.
cypher175 Posted April 8, 2009 Author Posted April 8, 2009 thanx for the help.. but im still a lil confused though.. been up for too long.. Would you mind giving me an example code/script please of: getting the object reference of a checkbox by its name/ID, then determining if its ticked or unticked, then message box if its ticked or unticked..
cypher175 Posted April 8, 2009 Author Posted April 8, 2009 Can anyone that knows how to do this, please give me an example..!!!
Authenticity Posted April 9, 2009 Posted April 9, 2009 #include <IE.au3> Dim $o_IE = _IECreate('http://www.w3schools.com/html/tryit.asp?filename=tryhtml_checkbox') Dim $oFrame = _IEFrameGetObjByName($o_IE, 'view') Dim $oChecks = _IETagNameGetCollection($oFrame, 'input') For $i = 1 To 2 For $oCheck In $oChecks ConsoleWrite(_IEFormElementGetValue($oCheck) & @TAB & 'Is ') If $oCheck.Checked Then ConsoleWrite('checked' & @LF) Else ConsoleWrite('not checked' & @LF) EndIf $oCheck.Checked = True Next Next
PsaltyDS Posted April 9, 2009 Posted April 9, 2009 #include <IE.au3> Dim $o_IE = _IECreate('http://www.w3schools.com/html/tryit.asp?filename=tryhtml_checkbox') Dim $oFrame = _IEFrameGetObjByName($o_IE, 'view') Dim $oChecks = _IETagNameGetCollection($oFrame, 'input') For $i = 1 To 2 For $oCheck In $oChecks ConsoleWrite(_IEFormElementGetValue($oCheck) & @TAB & 'Is ') If $oCheck.Checked Then ConsoleWrite('checked' & @LF) Else ConsoleWrite('not checked' & @LF) EndIf $oCheck.Checked = True Next Next @Authenticity: I like the use of w3schools example page to demo. Sweet! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now