Categories
Programming

HTML5 Url Input Can be Quite Strict

Following on from my articles on HTML5 Forms, I have been busy trying things out in various browsers, old and new.

I have noticed that the input of type “url” in HTML5 is being validated pretty strictly by some browsers.

For example, the following is treated as valid input:

  • http://www.stevefenton.co.uk/

But none of these are:

  • www.stevefenton.co.uk
  • stevefenton.co.uk

So you may want to help your users by giving them some appropriate place-holder text, a good label for the input field or by partly completing the field with”http://”.