# WRTKit FormButton Class

## Description

The FormButton class implements a control that is intended for use in form-style user interfaces. A form button is typically used to let users trigger actions.

Figure 1. FormButton controls

## Inherits from

ActionControl

Parent topic: WRTKit API Reference

## Constructor

### Syntax

    [FormButton] new FormButton(String id, String text)

### Description

Creates a new instance of the FormButton class.

### Arguments

- id

  Unique identifier for the control. Can be retrieved using the id property defined in the UIElement class that this control inherits from. Useful for example to identify the source of an event in event callback functions or to apply a CSS rule to only this particular control. The identifier can be null, in which case no id will be set for the control.

- text

  Text that is displayed on the face of the button. Typically this should be a verb that indicates what happens when the button is pressed. The value is an XHTML string.

### Return value

A new instance of the FormButton class.

## getText()

### Syntax

    [String] FormButton.getText(void)

### Description

Retrieves the current text of the button. The value is an XHTML string.

### Arguments

This method does not take any arguments.

### Return value

The current text of the button.

## setText()

### Syntax

    [void] FormButton.setText(String text)

### Description

Sets the text of the button. The text is displayed on the face of the button and indicates what happens when the button is pressed. The value is an XHTML string.

### Arguments

- text

  The text to be displayed on the face of the button. Passing null results in no text.

### Return value

This method does not return a value.