[wp-trac] [WordPress Trac] #24475: The empty pattern attribute causes Webkit (Chromium 25) to style the URL and Email HTML5 form fields always with :invalid styles.

WordPress Trac noreply at wordpress.org
Fri May 31 23:20:56 UTC 2013


#24475: The empty pattern attribute causes Webkit (Chromium 25) to style the URL
and Email HTML5 form fields always with :invalid styles.
--------------------------+--------------------------------------
 Reporter:  nico23        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  trunk
 Severity:  normal        |   Keywords:  dev-feedback needs-patch
--------------------------+--------------------------------------
 Chromium Version 25.0.1364.160 Ubuntu 13.04 (25.0.1364.160-0ubuntu3)

 `input type="email" pattern=""`
 `input type="url" pattern=""`

 This code is generated for the HTML5 form in Wordpress.

 I am using bootstrap 3.0 CSS and it styles the `input:focus:invalid:focus`
 and `input:focus:invalid` with a red border and text. The issue is using
 the empty pattern variable the browsers marks everything as invalid. I
 simply removed the `pattern=""` and the validation works, the browser then
 uses default pattern and the styles get removed as soon as the input in
 that fields are valid. I not tested it with manual pattern that will of
 course work as well.

 Not sure what the reason is you used empty pattern, I am new to this
 thing, but you might want to remove it or include some default pattern to
 be able to correctly validate the Email and URL.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24475>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list