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 #182542 is a reply to message #182530] Mon, 12 August 2013 17:43 Go to previous messageGo to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
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`
[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 Nov 28 03:01:35 GMT 2024

Total time taken to generate the page: 0.05555 seconds