FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Limiting # characters in textarea
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Limiting # characters in textarea [message #182544 is a reply to message #182542] Mon, 12 August 2013 22:13 Go to previous messageGo to previous message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma:
Senior Member
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?-
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Sexy CATHERINE ZETA JONES Sex Scandals
Next Topic: Email attachment 0bytes using php4
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 23:40:44 GMT 2024

Total time taken to generate the page: 0.06867 seconds