# WRTKit TextField Class

## Description

The TextField class implements a single line text entry control. The control is useful for situations where text is relatively short and doesn't need to span multiple lines. The text field also supports masked entry, which is good in situations where passwords or other secret text is entered.

Figure 1. TextField control

## Inherits from

TextEntryControl

Parent topic: WRTKit API Reference

## Constructor

### Syntax

    [TextField] new TextField(String id, String caption, String text, Boolean masked)

### Description

Creates a new instance of the TextField 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.

- caption

  The caption text for the control. A null caption can be used to hide the caption area. The value is an XHTML string.

- text

  The text to display in the text field. If the argument is omitted or null then the text field will not contain any text when created. The value is a plain text string (not XHTML).

- masked

  If the masked argument is true then the text field will be created in masked text entry mode. If the argument is omitted or false then the control will be created in normal text entry mode.

### Return value

A new instance of the TextField class.