Textbox

Members


text

string

The text in the textbox

displayText

string

The display text in the textbox (readonly)

placeholder

string

The placeholder text in the textbox

number

any

integer|number The number in the textbox (best to use with isNumeric)

allowDecimal

boolean

If the textbox allows decimals (does not set isNumeric for you)

isNumeric

boolean

If the textbox only allows numbers

isHex

boolean

If the textbox allows hex numbers (does not set isNumeric for you)

isPassword

boolean

If the textbox is a password field

maxLength

integer

The maximum length of the textbox

cursor

integer

The position of the cursor in the textbox

focused

boolean

If the textbox is focused

isEmpty

boolean

If the textbox is empty (readonly)

new

boolean

If the text has changed since the last time you checked new, reading it will set it to false (readonly)

confirmed

boolean

If the user pressed enter, reading it will set it to false (readonly)

validity

any

string|"valid"|"invalid"|"none" The validity of the textbox content

hasSelection

boolean

If the textbox has a selection (readonly)

selectionStart

integer

The start of the selection, check hasSelection first (readonly)

selectionStop

integer

The end of the selection, check hasSelection first (readonly)




Obtaining

The following function can return this type.

[Textbox] textbox = gui.newTextbox(text, placeholder, maxLength)