How to add maxLength on ion-input?

devquora
devquora

Posted On: Feb 22, 2018

 

    1 Answer Written

  •  devquora
    Answered by devquora

    To add a maxLength attribute to an ion-input element in Ionic, you can simply add the attribute to the input tag like this:

    <ion-input type="text" maxlength="10"></ion-input>

    In the above example, maxlength is set to 10, which means the input will allow a maximum of 10 characters to be entered.

Related Questions

Please Login or Register to leave a response.

Related Questions

IONIC Framework Interview Questions

What is Ionic Framework?

IONIC framework is an HTML5 platform that enables web developers to build hybrid mobile apps. Hybrid apps are those app..

IONIC Framework Interview Questions

What is the difference between PhoneGap, Cordova, and Ionic?

Cordova: Cordova is a JavaScript framework that builds apps, which can access the device hardware. Cordova cannot buil..

IONIC Framework Interview Questions

Who developed Ionic framework?

Ionic Framework was created by Drifty Co. in 2013 and developed by Max Lynch, Ben Sperry, and Adam Bradley...