programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Website by URL, How to Play YouTube Videos in by using Jquery , Jquery Change div background on mouseover in , JQuery UI Datepicker (Calendar) etc.

Wednesday, September 3, 2014

Limit Number of Characters in a TextArea using jQuery

jQuery MaxLength for INPUT and TEXTAREA: | Limit Number of Characters in a TextArea using jQuery:

In this post we see an Example in which we take a text box control and count number of entered character at run time. Some time we need this type of code when we working on web application. As like use restriction on comment section or Address section or some time when we take feedback for user. Here we consider solution of this type of code by using Jquery. jquery related other post:

How to limit characters inside a text area in

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<title> </title>
<script type="text/javascript" src=""></script>
<script type='text/javascript'>
    $(function () {
        $('#textarea1').keyup(function () {
            var desc = $('#textarea1').val();
            var len = desc.length;
            if (desc.length >= 150) {
                this.value = this.value.substring(0, 150);
            $('#spam1').text(150 - len + ' Characters Left');
    <style type="text/css">
            width: 465px;
            height: 87px;
<div align="center">
<h1>limit characters inside a text area in |
<br />

Limit Number of Characters in a TextArea using jQuery:</h1>
    <br />
<textarea id="textarea1"></textarea><br/>
<span id="spam1"> 150 Characters left</span></div>

Limit number of characters entered by Jquery:

Limit Number of Characters in a TextArea using jQuery

Restrict number of characters entered in textarea by jquery:

Some time we search this Question in google these type, We type on searchbox as like jQuery Limit Number of Characters in a TextArea or jquery textarea limit characters per line or jquery limit textarea length or jquery count characters in textarea or limit number of characters in textarea javascript or limit characters in textarea using javascript or jquery textarea max length and jquery textarea counter. Related Other Post:

No comments:

Post a Comment