[Bug 13173] WF2: <input type="url"> should accept URLs with protocol omitted

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13173

--- Comment #4 from Marat Tanalin <mtanalin@yandex.ru> 2011-07-07 23:42:14 UTC ---
(In reply to comment #3)
> That's a bad idea.  It makes it harder for authors to deal with the URL -- it
> will no longer resolve using any normal means.  The format of the URL submitted
> to the server should be consistent, so that it's as easy to use as possible.

All we know that client-side validation is solely for user, not for developer.
Client-side validation just makes user experience better by providing fast
validation-error messages without need for page reloading and waiting for
server response; such validation does not ensure data that server receives is
actually correct. Data that goes from browser should be revalidated on
server-side anyway according to good practices as for security.

To make <input type="url"> _usable_ for user, there should be an _explicit_ way
(understandable by user-agents) to make explicit protocol specifying optional.
This is necessary since most URLs that are typed into form fields in internet
are HTTP URLs, and forcing user to always specify protocol explicitly is
redundant, descreases usability, and forces developer to use old <input
type="text"> instead.

A possible solution is to make protocol in <input type="url"> optional by
default. Another solution is to provide an attributes for setting options
specific to input's type.

For example, in this case, this may be a boolean option attribute
"type-protocol-required":

<input type="url" type-protocol-required>

which makes protocol specifying by user required (if it's optional by default),

or "type-protocol-optional":
<input type="url" type-protocol-optional>

which makes protocol optional (if it's required by default).

"type-" here could be a common prefix (sort of namespace like "data-") for
attributes intended to store specific input type options.

A relatively acceptable alternative is to add new separate input type:
"http-url" or "httpurl":
<input type="http-url">

where URL value can have only "http://" protocol -- either explicitly entered
or omitted.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 7 July 2011 23:42:20 UTC