W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] <textarea> maxlength vs. wrap (Web Forms 2.0 2004-06-27)

From: Wrigley, Ave <Ave.Wrigley@itn.co.uk>
Date: Thu, 12 Aug 2004 14:38:47 +0100
Message-ID: <5984AE6FCA91944C8E4FAABA4F2822BA019B3F91@mx2.ITN.LOCAL>
 > When a <textarea> has wrap="hard", does the maxlength refer 
> to the number of characters entered by the user (and seen by
> the DOM) or the 
> number of characters submitted by the form, i.e. including the extra 
> line breaks?
> 
> The definition of maxlength says it is "the maximum length of
> the input, in terms of numbers of characters". I can see why, from an 
> implementation point of view, you would want to base it on 
> the number of characters seen by the DOM. However, this might be 
> counter-intuitive for developers, who might expect it to limit the
number of characters 
> submitted (even if the server should handle this situation).
> 
> Could the definition of wrap="hard" take this into account?

This is a very good point. My feeling is that the maxlength should apply
to the number of characters that are submitted, although I am surprised
that this is different from the number seen by the DOM. I guess the
correct implementation would be for the DOM value to include the line
breaks.

Ave.




This email (and any attachments) is intended solely for the individual(s) to whom addressed. It may contain confidential and/or legally privileged information. Any statement or opinions therein are not necessarily those of ITN unless specifically stated. Any unauthorised use, disclosure or copying is prohibited. If you have received this email in error, please notify the sender and delete it from your system. Security and reliability of the e-mail and attachments are not guaranteed. You must take full responsibility for virus checking.



Independent Television News Limited, 

Registered No. 548648 England,

VAT Reg. No: GB 756 2995 81, 

200 Gray's Inn Road, London WC1X 8XZ,

Telephone: 020 7833 3000.
Received on Thursday, 12 August 2004 06:38:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:36 UTC