[imps] Forms Constraint Validation : validationMessage

Ian Hickson ian at hixie.ch
Fri Mar 26 00:09:00 PDT 2010

On Fri, 12 Mar 2010, Mounir Lamouri wrote:
> The specs say, when the element is candidate for constraint validation 
> and doesn't satisfy its constraints, the validationMessage 'must return 
> a suitably localized message that the user agent would show the user 
> [...]' and when the element suffers form a custom error it should be the 
> return value.
> As I understand it, that means :
> if (IsCandidateForConstraintValidation())
> {
>   if (!IsValid())
>   {
>     if (IsSufferingFromCustomMessage())
>       ShowCustomMessage();
>     else
>       ShowMessage();
>   }
> }
> But the 'ShowMessage()' is not clearly defined. If the element is 
> suffering from more than one error, according to the specs, if one of 
> them is custom error, the function should return the custom error string 
> but if the element is suffering from more than one error and none of 
> them is the custom error what should be the error string ?
> I think UA are going to return a message that will correspond to only 
> one of the constraint errors, classifying themselves the errors. As far 
> as I can tell Webkit is doing that. So, should the specifications set a 
> prioritized list of errors to return or should it be UA specific ?

It's basically up to the user agent. I suppose we could set a priority 
list, but I don't think it necessarily really would help authors much. 
This is the kind of thing for which implementation experience (once 
authors start using it) would be quite useful for, though.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the Implementors mailing list