h5Validate
h5Validate copied to clipboard
Default Pattern Library needs to include the HTML5 standard patterns for email and URL
There are good email and url patterns in my checked out branch right now, but the HTML5 form specification mentions specific patterns for email and URL that must be implemented in order for the feature to be compliant.
I looked for the patterns in the spec last night and couldn't find them. Anybody know where they are located?
Doesn't it sayhere? http://www.w3.org/TR/2010/WD-html-markup-20101019/datatypes.html#form.data.emailaddress-def
Any string that matches the following [ABNF] production: 1_( atext / "." ) "@" ldh-str 1_( "." ldh-str )
This should be transferrable to a regexp pattern right?
Thanks, Daniel - That's exactly what I was looking for. Will replace my placeholder patterns with all of these. Just forgot where to find them! =)
Short question on this one: It seems like inputs of type email are not validated with the plugin. Will this be added soon or do I make a mistake?
drublic - h5Validate doesn't yet automatically validate the new HTML5 input types with appropriate patterns. The reason for that is that I want to be careful to use the specification standards for consistency. That is on the roadmap for 1.0.
That said, there is an email pattern in the pattern library. You can use it simply by attaching a class to your element (see the "pattern library" section here: http://ericleads.com/h5validate/ ).
There is a known bug right now: the validation is case sensitive. It is scheduled to be fixed within the next couple weeks (possibly much sooner).
Hi dilvie, thanks for your response. I figured out how to do it :) Pretty cool…
That case-sensitivity bug is fixed, by the way. =)
the standard pattern are buggy, because they accept [email protected] (one Letter TLD) and TLDs ending with a . (dot)
Conform to test cases here:
http://trac.webkit.org/browser/trunk/LayoutTests/fast/forms/resources/ValidityState-typeMismatch-email.js http://trac.webkit.org/browser/trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-url.js