WTUI Docs

WTUI  1.0.0

WTUI Docs > WTUI > WTUI.PlainTextControl
Search:
 
Filters

Class WTUI.PlainTextControl

A Plain Text Control

Tag

<wtui:control type="WTUI.PlainTextControl"/>

The tag for WTUI.PlainTextControl

Example:

<wtui:control type="WTUI.PlainTextControl" id="usernameid" name="username" placeholder="Type username here"/>
Parameters:
id <String> (optional) The id of the plain text control
name <String> (optional) The name of the control if it is used within a form
value <String> (optional) The value of the control
placeholder <String> (optional) The placeholder text to put in the control
allow <String> (optional) a regular expression defining which characters this control should allow
multiline <String> (optional) set to yes for a multiline control
onkeypress <Function> The function to call when a key is pressed

Methods

getValue

String getValue ( )

Get the value

Returns: String
The value of the control

setValue

void setValue ( value )

Set the value

Parameters:
value <String> The value
Returns: void

Events

blur

blur ( )

This event is fired when the control loses focus

Example:

WTUIComponent('textid').on('blur', function() {
  alert('blur');
});

change

change ( )

This event is fired when the value of the control changes

Example:

WTUIComponent('textid').on('change', function() {
  alert('change');
});

keypress

keypress ( code )

This event is fired when a key is pressed in the control

Example:

WTUIComponent('textid').on('keypress', function(code) {
  alert(code);
});
Parameters:
code <String> the code for the key which was pressed

WTUI