Form error messages and default presentation of invalid state

Section 4.10.20.2 Constraint validation has very little requirements regarding how form error conditions are presented to the user, and suggests that merely focusing an element is sufficient.

While I agree that UAs should have freedom of implementation, I think the spec currently sets the bar too low. It should require UA to display error message or at least make invalid controls visually different from valid controls.

The problem for me is Chrome's implementation, which does nothing besides focusing the element. I think it's confusing for users. Lack of any explanation or any hint that focus is in response to error condition makes website/browser appear to be broken. 

Test case:

<form action="data:text/plain,ok">
<input type=number value=100 max=50 autofocus>
<input type=submit>

In Chrome submit button doesn't appear to do anything. User has no way of discovering what's the maximum allowed value.

I know this can be worked around with JS+CSS, but I'd like default behavior to be useful. Requiring authors to add extra error handling diminishes value of built-in validation and misses opportunity for standard, consistent display of form errors.

-- 
regards, Kornel

Received on Friday, 30 July 2010 10:35:39 UTC