Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to show max words left to insert into text area

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 435
    Comment on it

    Hello Reader's if you are making the html5 validation to set the max words inside the html form, Then by using Angular JS NG-Model you can easily make it. Lets's see how to do it as in the example below:-

    <!DOCTYPE html>
    <html>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
    <body ng-app="myNoteApp" ng-controller="myNoteCtrl">
    <textarea ng-model="message" cols="40" rows="10"></textarea>
    <p>
    <button ng-click="save()">Save</button>
    <button ng-click="clear()">Clear</button>
    </p>
    <p>Number of characters left: <span ng-bind="left()"></span></p>
    <script src="myNoteApp.js"></script>
    <script src="myNoteCtrl.js"></script>
    </body>
    </html>
    

    Now in the code above when user type the words it will show the remaining word in the next line;.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: