W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2007

[whatwg] Web Forms attributes: minlength / autocomplete

From: Michel Fortin <michel.fortin@michelf.com>
Date: Wed, 06 Jun 2007 23:44:03 -0400
Message-ID: <BA604879-5E82-423B-B98E-3826A6D3B3D9@michelf.com>
Le 2007-06-06 ? 6:56, Sander a ?crit :

> I'd like to see a minlength attribute that can be used on the same  
> elements as the maxlength attribute.

I'm not sure a minlength attribute like this can be consistent with  
maxlength.

The maxlength attribute prevents users from entering more characters  
than the attribute's value. Should a minlength attribute prevent you  
from erasing characters when it would cause the value to be less  
characters than specified? That would be strange, if not completely  
useless.

Also, the maxlength attribute also cause the truncation of any value  
set on the input. For instance, if your markup contains this:

     <input maxlength="3" value="12345">

... it'll result in the value being truncated to "123". Should an  
input with minlength smaller than it's value be filled with padding  
characters? Before or after the value? And what happens to those  
characters as you type?

If that's not what you want (and I'm pretty sure it's not) I don't  
think such an attribute, if added, should be called minlength.  
Perhaps requiredlength or something like that would fit better.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/
Received on Wednesday, 6 June 2007 20:44:03 UTC

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