Friday, September 26, 2014

Display number of character left and count word in asp.net multiline textbox using Jquery plugin

Introduction: In this article today I am going to explain how we can display number of character left and count word in asp.net multiline textbox using Jquery plugin

Description:


We need the multiline textbox or textarea in our websites to stop the copy and paste of content.
 To make it function, design the .aspx page as code given below:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
            <script src="js/jquery.textareaCounter.plugin.js" type="text/javascript"></script>   
            <script type="text/javascript">
                var info;
                $(document).ready(function () {             
                    var options = {
                        'maxCharacterSize': 150,
                        'originalStyle': 'originalTextareaInfo',
                        'warningStyle': 'warningTextareaInfo',
                        'warningNumber': 40,
                        'displayFormat': '#left Characters Left | #words words'
                    };
                    $('#txtarea').textareaCount(options)
                       
                });
            </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <center>
    <fieldset style="width:50%;height:auto">
    <legend>Example of Display number of character left and count word</legend>
    Enter Description: <asp:TextBox ID="txtarea" runat="server" TextMode="MultiLine" Height="100px" Width="550px" placeholder="Enter Description"></asp:TextBox>
        </fieldset>
        </center>
    </div>
    </form>
</body>
</html>

Note: To download the used Jqurey download the project from below given option.


Bulid , run the project and see the result.

Output:

Display number of character left and count word in asp.net multiline textbox using Jquery plugin

Download project :

download

Is this article helpful for you?
If yes post your comment to appreciate my work and fell free to contact me. You can like me on Facebook, Google+, Linkedin and Twitter via hit on Follow us Button and also can get update follow by Email.

1 comment:

  1. My relatives all the time say that I am wasting my
    time here at net, however I know I am getting knowledge
    all the time by reading thes fastidious articles.

    Also visit my blog post; ganhar dinheiro na internet

    ReplyDelete