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:
In the previous article I have explained Format theemails using StringBulider in asp.net, Disable copy,
cut, paste and drop options in asp.net textbox using Jquery, Explain
cookies in asp.net OR Explain cookies with example in asp.net, Explain
viewstate in asp.net OR Viewstate and its advantage or disadvantages and State
Management in Asp.net.
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>
Bulid , run the project and see the result.
Output:
Download project :
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.
My relatives all the time say that I am wasting my
ReplyDeletetime 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