Home > Language Reference > Web Functions > GetHTMLEditText

GetHTMLEditText

The GetHTMLEditText function captures the content of a text field web form.

Usage

Used to check what has been typed in a web form.

Syntax

ret=GetHTMLEditText(<html_descriptor>, var$)

Parameters

<html_descriptor>, string, HTML descriptor of the HTML element to capture. Use Spy tool to generate the <html_descriptor> parameter.

var$, string, captured text.

Return value

Ret, optional numeric return code. If the function succeeds, the return value is 0. If the function fails, the return value is a nonzero value (see Web Functions Error Codes).

Remarks

GetHTMLEditText does not include any synchronization; a UsePage must be used before to be sure that the element to capture is ready.

See also

CaptureHTML
CaptureTableHTML

Examples

'Example on the demonstration pages of wintask web site, let's capture the content of a TextArea field.
StartBrowser("IE", "www.wintask.com/demos")
UsePage("WinTask Demonstration Pages")
ClickHTMLElement("A[INNERTEXT= 'Form']")
UsePage("Form")
WriteHTML("TEXTAREA[NAME= 'message']", "bla bla bli")
SelectHTMLItem("SELECT[NAME= 'subject']", "Web site")
ret=gethtmledittext("TEXTAREA[NAME= 'message']",var$)
msgbox(var$)
WriteHTML("INPUT TEXT[NAME= 'name']", "Test")
WriteHTML("INPUT TEXT[NAME= 'email']", "test@test.com")
Gethtmledittext("INPUT TEXT[NAME= 'email']",var$)
msgbox(var$)
ClickHTMLElement("INPUT RESET[VALUE= 'Clear']")
CloseBrowser()



'Example on the demonstration pages of wintask web site loaded in Firefox, let's capture the content of a TextArea field.
StartBrowser("FF", "www.wintask.com/demos")
UsePage("WinTask Demonstration Pages")
ClickHTMLElement("A[INNERTEXT= 'Form']")
UsePage("Form")
WriteHTML("TEXTAREA[NAME= 'message']", "bla bla bli")
SelectHTMLItem("SELECT[NAME= 'subject']", "Web site")
ret=gethtmledittext("TEXTAREA[NAME= 'message']",var$)
msgbox(var$)
WriteHTML("INPUT TEXT[NAME= 'name']", "Test")
WriteHTML("INPUT TEXT[NAME= 'email']", "test@test.com")
Gethtmledittext("INPUT TEXT[NAME= 'email']",var$)
msgbox(var$)
ClickHTMLElement("INPUT RESET[VALUE= 'Clear']")
CloseBrowser()


'Example on the demonstration pages of wintask web site loaded in Chrome, let's capture the content of a TextArea field.
StartBrowser("CH", "www.wintask.com/demos")
UsePage("WinTask Demonstration Pages")
ClickHTMLElement("A[INNERTEXT= 'Form']")
UsePage("Form")
WriteHTML("TEXTAREA[NAME= 'message']", "bla bla bli")
SelectHTMLItem("SELECT[NAME= 'subject']", "Web site")
ret=gethtmledittext("TEXTAREA[NAME= 'message']",var$)
msgbox(var$)
WriteHTML("INPUT TEXT[NAME= 'name']", "Test")
WriteHTML("INPUT TEXT[NAME= 'email']", "test@test.com")
Gethtmledittext("INPUT TEXT[NAME= 'email']",var$)
msgbox(var$)
ClickHTMLElement("INPUT RESET[VALUE= 'Clear']")
CloseBrowser)