EnabledHTMLElement

Web function.

The EnabledHTMLElement function checks if the specified html element is enabled or disabled. Not available in WinTask Lite.

Usage

For advanced users, it allows to test if an HTML element is enabled or disabled.

Syntax

ret=EnabledHTMLElement(<html_descriptor>)

Parameters

<html_descriptor>, identifier of the HTML element to test within the current Web page specified by the last UsePage. Use Recording mode for generating automatically the html descriptor.

Return value

Ret, numeric return code. If the specified HTML element is enabled, the function returns 1, if it is disabled, the function returns 0. If there is no previous UsePage or the specified element is not found or the HTML descriptor is invalid, the function returns -1.

Remarks

EnabledHTMLELement function does not check if the element to test has finished to load, it does not include any synchronisation. So always write a UsePage before using EnabeldHTMLElement: the UsePage makes the automatic synchronization and so the line after the UsePage will be executed only when all the elements on the page are loaded.

Example

 

'Check if an HTML element is enable on a demo page.

StartBrowser("IE", "http://www.wintask.com/demos/formdisable.htm")

UsePage("Multiple")

ret=EnabledHTMLElement("INPUT BUTTON[VALUE= 'Disable']")

msgbox(ret) 'returns 0

ret=EnabledHTMLElement("INPUT BUTTON[VALUE= 'Enable']")

msgbox(ret) 'returns 1