[whatwg] Web Forms attributes: minlength / autocomplete
Michel Fortin
michel.fortin at michelf.com
Wed Jun 6 20:44:03 PDT 2007
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/
More information about the whatwg
mailing list