CheckedHTML
Web function.
The CheckedHTML function retrieves the state of the specified check box or radio button in an HTML form. Not available in WinTask Lite.
Usage
Mainly used for testing purposes when you need to check that your Web site is displayed as expected.
Syntax
ret=CheckedHTML(<html_descriptor>)
Parameters
<html_descriptor>, HTML descriptor of the check box or radio button to check in the HTML form. See Remarks for finding this HTML descriptor.
Return value
Ret, numeric return code. When the specified check box or radio button is checked, the function returns 1 ; otherwise it returns 0. If the HTML object to test is not recognized as a check box or radio button, or the object is not there, or the descriptor is invalid or no UsePage is done before, the return code is -1. You can use ExistHTMLElement statement before in order to ensure that the object exists.
Remarks
For finding the <html_descriptor> for the checkbox/radio button, use Recording mode and record the action of checking the box. Stop Recording mode, the generated line ClickHTMLElement contains the html descriptor, copy and paste the generated html descriptor within the CheckedHTML statement and delete the ClickHTMLElement line.
CheckedHTML does not include any synchronization ; a UsePage must be used before to be sure that the checkbox is ready.
Example
'On the form for downloading WinTask, we check the status of one check box
StartBrowser("IE", "www.wintask.com")
UsePage("WinTask - Automation software and Task Scheduler. Macro software with Macro Recorder")
ClickHTMLElement("A[INNERTEXT= 'Free Downloads']")
UsePage("WinTask - FREE 30 Day Trial Offer")
'On the form, is the checkbox Quick Start Guide checked ?
ret=CheckedHTML("INPUT CHECKBOX[NAME= 'quickstartguide']")
msgbox(ret)