Limitation of Characters in Textbox or TextArea

Limitation of Characters in Textbox or TextArea in asp.net using jquery:



Limit number of characters entered by Jquery in asp.net multiline textbox control or jquery count characters in textarea or limit number of characters in textarea jquery or limit characters in textarea using javascript or jquery textarea max length and jquery textarea counter these are important and similar type Questions. In this asp.net tutorial we consider an example and use “MaxLength.min.js” for counting the entered character at run time by the help of this JQuery.

Jquery Related Other post:


Restrict number of characters entered in textarea by jquery:

Limit Number of Characters in a TextArea using jQuery see this post for html input type textbox validation of maximum number of character.

jQuery Maxmum Limit of  Characters in an Asp.net Textbox or TextArea:

use give fallowing jquery for this .
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript" src="MaxLength.min.js"></script>

Jquery function for count character:

<script type="text/javascript">
        $(function () {
            //Normal Configuration of count character in asp.net web application when use MultiLine_TextBox1
            $("[id*=MultiLine_TextBox1]").MaxLength({ MaxLength: 100 });

            //use MultiLine TextBox and Specifying the Character Count control explicitly
            $("[id*=MultiLine_TextBox2]").MaxLength(
            {
                MaxLength: 105,
                CharacterCountControl: $('#counter')
            });
        });
    </script> 


jquery multiline textbox control or textarea limit characters Input :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript" src="MaxLength.min.js"></script>
    <script type="text/javascript">
        $(function () {
            //Normal Configuration of count character in asp.net web application when use MultiLine_TextBox1
            $("[id*=MultiLine_TextBox1]").MaxLength({ MaxLength: 100 });

            //use MultiLine TextBox and Specifying the Character Count control explicitly
            $("[id*=MultiLine_TextBox2]").MaxLength(
            {
                MaxLength: 105,
                CharacterCountControl: $('#counter')
            });
        });
    </script>
</head>
<body>
   <form id="form1" runat="server">
    <div align="center">
        <fieldset>Limit number of characters.
          
            <h1>
            Show number of characters remaining in  Asp.net TextArea
            <br />
                or
            <br />
                MultilineTextbox
            </h1>
             <h2>Blank Asp.net Textbox </h2>
            <asp:TextBox ID="MultiLine_TextBox1" runat="server" TextMode="MultiLine" Width="300" Height="100"></asp:TextBox>
            <br />
            <br />  

            <h2>Asp.net Textbox with some value</h2>           
            <asp:TextBox ID="MultiLine_TextBox2" runat="server" TextMode="MultiLine" Width="300" Height="100"
                Text="Hello friends this is asp.net tutorial blog"></asp:TextBox>
                <div id="counter">
            </div>
            <br />
            <br />
        </fieldset>
    </div>
    </form>
</body>
</html>

Limit textarea or multiline textbox  length using Jquery :

Limitation of Characters in Textbox or TextArea

                               jQuery Limit Number of Characters in Textarea


Asp.net Related Other Post:






Comments

Popular posts from this blog