Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10497

Re: Limiting # characters in textarea

From Norman Peelman <npeelman@cfl.rr.com>
Newsgroups comp.lang.php
Subject Re: Limiting # characters in textarea
Date 2013-08-12 18:13 -0400
Organization A noiseless patient Spider
Message-ID <kubmms$k8g$1@dont-email.me> (permalink)
References <ku699n$77d$1@speranza.aioe.org> <ku6i13$vv5$1@dont-email.me> <kub6r8$9ui$1@speranza.aioe.org>

Show all headers | View raw


On 08/12/2013 01:43 PM, Twayne wrote:
> On 2013-08-10 7:23 PM, Norman Peelman wrote:
>> On 08/10/2013 04:54 PM, Twayne wrote:
>>> Hi all,
>>>
>>> Win 7, XAMPP Local Server, PHP 5.3. Target; Online Submitted Forms for
>>> the general public:
>
>>> Using only HTML or PHP or a combo of the two, might anyone here have a
>>> proven method for limiting the length of a textarea other than
>>> truncating it without the sender's knowledge?
>>>
>>> Except for js and the like, I'm open to alternatives, of course.
>>> Although code is always nice, air code often suffices too.
>>>
>>> Thanks in advance,
>>>
>>> Twayne`
>>
>>    maxlength has been around long before HTML5... The <input> control
>> will simply stop accepting characters. Without JS, it will just truncate
>> upon insertion, even from copy/paste. You'll just have to indicate that
>> data entry for that field is limited.
>>
>
> Not quite unfortunately. What you say is true, with the exception of
> using a <textarea>. Maxlength simply will not work with a textarea (Not
> talking about "input" etc. here) and never has until it was added for
> HTML 5.
>     Try it; create a textarea with a length of say 10 and use maxlength;
> it will not work unless you're able to handle the latest HTML 5 code.
> Regards,
>
> Twayne`
>

   Yes, I noticed the disclaimer a little too late... works in Google 
Chrome and Firefox but not Opera and IE 9 and earlier. Tested except for IE.

-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Limiting # characters in textarea Twayne <nobody@spamcop.net> - 2013-08-10 16:54 -0400
  Re: Limiting # characters in textarea Martin Leese <please@see.Web.for.e-mail.INVALID> - 2013-08-10 17:11 -0600
    Re: Limiting # characters in textarea Twayne <nobody@spamcop.net> - 2013-08-10 19:23 -0400
      Re: Limiting # characters in textarea BootNic <bootnic.bounce@gmail.com> - 2013-08-10 21:57 -0400
  Re: Limiting # characters in textarea Norman Peelman <npeelman@cfl.rr.com> - 2013-08-10 19:23 -0400
    Re: Limiting # characters in textarea Twayne <nobody@spamcop.net> - 2013-08-12 13:43 -0400
      Re: Limiting # characters in textarea Norman Peelman <npeelman@cfl.rr.com> - 2013-08-12 18:13 -0400
  Re: Limiting # characters in textarea Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-10 19:36 -0400
  Re: Limiting # characters in textarea Richard Damon <Richard@Damon-Family.org> - 2013-08-10 20:52 -0400
    Re: Limiting # characters in textarea Twayne <nobody@spamcop.net> - 2013-08-12 13:48 -0400
  Re: Limiting # characters in textarea Allodoxaphobia <knock_yourself_out@example.net> - 2013-08-11 16:39 +0000

csiph-web