input type =“url” for relative URLs

I had a input box for users to enter in a custom link to a page from the creation form (somewhat similar to Wordpress). (e.g. about/awards which gets used for http://site.com/pages/about/awards ) At some point, this stopped working in Chrome, as they now do stricter validation of input type="url" field. Which would be good but:

  • It doesn't allow relative urls. about/awards is a relative URL, but Chrome seems to reject everything except absolute URLs http://domain/page/stuff
  • The failure isn't particularly obvious. It just focuses on the form field (which isn't particularly noticeable), and refuses to submit the form. The report I got was that the form "doesn't work", as they didn't notice what was going on, and it took me a few minutes to realise what is going on.

I've fixed it by just switching back to input type="text" but this defeats some of the useful stuff that type="url" added (such as the special keyboard on the iPhone).

Is this a part of the HTML5 spec, or a problem in Chrome's implementation?

9
задан Macha 8 September 2010 в 17:56
поделиться