Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

AngularJS TextArea Show Number of Characters Remaining Count

Jun 16, 2016
Introduction

Here I will explain how to use
AngularJS to show number of characters remaining in textarea or AngularJS show remaining characters count in textarea with example or AngularJS count characters in textarea and set maxlength to textarea in AngularJS with example. In AngularJS by using ng-model property we can count number of characters available in textarea.


To show number of characters left in textarea we need to use ng-model property in AngularJS for that we need to write the code like as shown below


<textarea ng-model="noofchars" ng-trim="false" cols="40" rows="7" maxlength="100"></textarea>
<span>{{100 - noofchars.length}} left</span>

If you want to check it in complete example you need to write the code like as shown below


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AngularJS Show Number of Characters Left in TextArea</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>
</head>
<body ng-app>
<textarea ng-model="noofchars" ng-trim="false" cols="40" rows="7" maxlength="100"></textarea>
<span>{{100 - noofchars.length}} left</span>
</body>
</html>

Demo

To see live demo try to enter text in textarea to see number of characters left.

{{100 - noofchars.length}} left

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

0 comments :

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.