<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 27. Simple inputtext

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

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 28. Simple inputtext

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

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 29. Password inputtext

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

Attributes

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

Methods

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

setEnabled()
inputtext.setEnabled(enabled : Boolean);
[Caution] This method is deprecated
Use setAttribute('enabled', ...) instead.
Sets whether user can modify input text field
Parameter Name Type Description
enabled Boolean true if the text field can be edited

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 lz.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