-2

which good (small and easy to use) jquery plugin to control the amount of characters in textarea Can I use?

When you finish entering a character, if the maximum amount was exceeded the character should be deleted.

I should not be allowed to enter up to a certain number of characters (parameter), compatible with Internet Explorer 6.0 and work when you copy and paste text.

Martin
  • 745
  • 2
  • 7
  • 23

2 Answers2

1

You dont need any javascript at all for that. just give the input a maxlength="somenumber". even if it is a text area. see my jsfiddle here http://jsfiddle.net/XKxHq/

Decker W Brower
  • 931
  • 6
  • 16
  • sorry, is textarea my html tag. – Martin Jul 14 '12 at 18:12
  • It doesn't work in Internet explorer 6.0. Only in new browsers. http://stackoverflow.com/questions/4372413/textarea-maxlength-supported-or-not-supported – Martin Jul 14 '12 at 22:43
0

Well, I do aggree with using the maxlength attribute. But if you want to use a textarea too, you need to use a plugin.
(As far as I know maxlength doesn't work with textarea.)

Consider using the jQuery validator(Another site here):

$(function() {

$("#yourform").validate({
    rules: {
        theinputname: "therule"
    },
    messages: {
        theinputname: "iferror"
    }
});

});
ZeeCoder
  • 1,001
  • 9
  • 17