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.
Description:
In previous articles I explained Angularjs show / hide div with radiobutton selection, Angularjs show confirm dialog box on ng-click, Angularjs enable / disable button on checkbox selection, Angularjs tutorial for beginners with hello world example, Angularjs refresh div for every 1 second using interval mode and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to show number of characters remaining in textarea using AngularJS.
In previous articles I explained Angularjs show / hide div with radiobutton selection, Angularjs show confirm dialog box on ng-click, Angularjs enable / disable button on checkbox selection, Angularjs tutorial for beginners with hello world example, Angularjs refresh div for every 1 second using interval mode and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to show number of characters remaining in textarea using AngularJS.
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
|
Demo
To
see live demo try to enter text in textarea to see number of characters 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. |
|||
|
|||
0 comments :
Note: Only a member of this blog may post a comment.