WebCheckBox

From Xojo Documentation


For desktop applications, see Checkbox.

Class (inherits from WebControl)


New in 2010r4

The standard checkbox used by web apps. This checkbox itself of this control is implemented as a native browser control.

Events
ValueChanged
Properties
Caption Value
Methods

Sample Code

Test to see if the user has checked the CheckBox:

If CheckBox1.Value Then
MsgBox("Checked!")
End If

You can also check the CheckBox in your code:

CheckBox1.Value = True

See the ControlWithName example in the Examples folder for an example of togglng a checkbox using the WebView.ControlWithName method. It uses ControlWithName in the following way.

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
End If

The TextField1 control contains a valid number, so the method is able to toggle that checkbox.

See Also

Checkbox, WebRadioGroup, WebPopupMenu classes; UserGuide:Web Check Box topic