<inputtext>
The basic input-text element.

JavaScript: lz.inputtext
extends <text> » <view> » <node> » lz.Eventable »

This tag creates an area of the canvas that the user can use to edit text. It is equivalent to the HTML <input type="text">, <input type="password">, and textarea tags.

See the documentation for the <text> tag for a description of the width and height attributes, and of scrolling.

Single-line input text

With the multiline and password attributes set to false (the default), this tag is similar to the HTML <input type="text"> tag. In this use, long lines of text are clipped according to the width attribute.

Example 26. Simple inputtext

<canvas height="50">
   <inputtext width="150">This text is editable.</inputtext>
 </canvas>

Multi-line input text

With the multiline attribute set to true, this tag is similar to the HTML <textarea> tag. In this use, text is wrapped to the length of the width attribute, and the user can press Enter to create multiple lines of input.

Example 27. Simple inputtext

<canvas height="50">
   <inputtext width="150" multiline="true">This text is editable.</inputtext>
 </canvas>

Passwords

With password set to true, this tag is similar to the HTML <input type="password"> tag. Input characters are displayed as the asterisk ('*') character.

Example 28. Password inputtext

<canvas height="20">
   <inputtext width="100" password="true">password.</inputtext>
 </canvas>

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
enabled boolean Boolean   read/write
  If true, the inputtext will be editable
password boolean Boolean   read/write
  If true, the inputtext contents will be obscured

Methods

getText()
inputtext.getText();
[Caution] This method is deprecated
Use the text attribute instead
Gets the contents of this inputtext

LzInputText()
inputtext.LzInputText(parent, attrs, children, instcall);
Parameter Name Type Description
parent    
attrs    
children    
instcall    

setHTML()
inputtext.setHTML(htmlp : Boolean);
Set the html flag on this text view
Parameter Name Type Description
htmlp Boolean If true, the text content is treated as HTML when displayed.

updateData()
inputtext.updateData();
Retrieves the contents of the text field for use by a datapath. See LzDatapath.updateData() for more on this.

Methods inherited from <formatter>

abbreviate, formatToString, pad

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
onenabled Sent whenever the text field is enabled.

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy