W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2010

[whatwg] Improve select required

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Tue, 16 Nov 2010 10:55:46 +0200
Message-ID: <4CE24712.4020000@peda.net>
2010-11-16 04:16 EEST: Ian Hickson:
> On Thu, 12 Aug 2010, Mikko Rantalainen wrote:
>> A possible use case where this feature could be useful already (and
>> cannot be fulfilled with @required):
>>
>> 1) An user is trying to register a new user account on some system
>>    and uses "foo" as the nick name.
>> 2) The registration form is otherwise successful, but the system
>>    returns with an error message saying that nick "foo" was already
>>    taken. In such case, the actual input field could be specified as:
>>
>>       <input type=text value="foo" disallow="foo">
>>
>>    That is, the field will be prefilled with "foo" but the field also
>>    contains extra information that the value "foo" will not be
>>    accepted in any case. The prefilled "foo" may have some value for
>>    the use and as a result, it does make more sense to prefil with
>>    "foo" instead of presenting an empty field with @required.
> 
> Sure, but there it's not just "foo" that's disallowed, it's any registered 
> username, and the better UI still would be to use a script to dynamically 
> check the values as the user types them (with setCustomValidity()).

I agree. A script that dynamically checks the server for up to date
information allows for better UI. However, I'd like to have as good an
UI as possible even in case scripting is disabled.

As I said earlier (repeated below), this can be implemented with
@pattern so @disallow is not required (no pun intented). My point was
that if we have something in addition to @pattern, I'd rather have
@disallow with a value than the @required without a sensible value.

>> The same behavior can already be implemented with @pattern but I believe 
>> that @disallow would be easier to understand to most authors. If 
>> @disallow were introduced, the @required should be removed completely 
>> because it doesn't provide any functionality not provided by @disallow.
> 
> I think disallowed="" would be a lot more confusing for most authors.

I don't have any evidence so I won't argue about that.

-- 
Mikko

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20101116/b79e93d4/attachment.pgp>
Received on Tuesday, 16 November 2010 00:55:46 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:28 UTC