[whatwg] Improve select required
mikko.rantalainen at peda.net
Tue Nov 16 00:55:46 PST 2010
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: OpenPGP digital signature
More information about the whatwg