h5Validate icon indicating copy to clipboard operation
h5Validate copied to clipboard

Default Pattern Library needs to include the HTML5 standard patterns for email and URL

Open ericelliott opened this issue 15 years ago • 9 comments
trafficstars

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.

ericelliott avatar Oct 15 '10 01:10 ericelliott

I looked for the patterns in the spec last night and couldn't find them. Anybody know where they are located?

ericelliott avatar Oct 16 '10 00:10 ericelliott

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?

danielmahal avatar Oct 28 '10 11:10 danielmahal

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! =)

ericelliott avatar Nov 04 '10 02:11 ericelliott

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 avatar Jan 24 '11 12:01 drublic

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).

ericelliott avatar Jan 24 '11 17:01 ericelliott

Hi dilvie, thanks for your response. I figured out how to do it :) Pretty cool…

drublic avatar Jan 26 '11 14:01 drublic

That case-sensitivity bug is fixed, by the way. =)

ericelliott avatar Feb 16 '11 01:02 ericelliott

the standard pattern are buggy, because they accept [email protected] (one Letter TLD) and TLDs ending with a . (dot)

AxelWinter avatar May 06 '11 17:05 AxelWinter

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

ericelliott avatar Nov 14 '11 05:11 ericelliott