WebView.ControlWithName

From Xojo Documentation

Method

WebView.ControlWithName(Name As String) As WebControl

New in 2010r4

Supported for all project types and targets.

Returns the WebControl with the specified Name. If Name is invalid, Nil is returned.

Example

This example lets the user type the name of a CheckBox into a TextField. If the CheckBox exists on the page, then its checked state is toggled:

Var cb As WebCheckbox
cb = WebCheckbox(Self.ControlWithName("Checkbox" + TextField1.Text))
If cb = Nil Then
MsgBox("There is no checkbox with the name: Checkbox" + TextField1.Text)
Else
cb.Value = Not cb.Value // toggles the checkbox
End If