Files
NativeScript/tests/app/ui/text-field/text-field.md
Nikolay Tsonev f9ec0c9aba add sample code snippet for maxLength property (#4429)
* add sample code snippet for maxLength property

* removing Page and StackLayout

* remove the other Page tag
2017-06-21 21:48:57 +03:00

1.3 KiB

nav-title, title, environment, description, previous_url
nav-title title environment description previous_url
TextField How-To text-field nativescript Examples for using TextField /ApiReference/ui/text-field/HOW-TO

TextField

Using a TextField requires the text-field module. {%snippet require-textfield%}

Binding two TextFields text property to observable view-model property.

{%raw%}<TextField text="{{ someProperty }}" />
<TextField text="{{ someProperty }}" />{%endraw%}

{%snippet binding-text-property-textfield%}

Creating a TextField

{%snippet creating-textfield%}

Setting the text of a TextField

{%snippet setting-text-property%}

Setting the text of a TextField

{%snippet setting-hint-property%}

Binding text property directly to model

{%snippet binding-text-property-second%}

Setting the hint of a TextField

{%snippet setting-hint-text%}

Binding hint property directly to model

{%snippet binding-hint-property-textfield%}

Setting the secure property of a TextField

{%snippet setting-secure-property%}

Binding secure property directly to model

{%snippet binding-secure-property%}

Setting the maxLength property of a TextField

<TextField autocorrect="false" hint="Setting Max text length(max 3 characters)" maxLength="3" />
<TextField autocorrect="false"  hint="Setting Max text length(max 3 characters) with secure='true'" maxLength="3" secure="true" />