Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 URL Input Box without Protocol

Tags:

html

url

firefox4

When you use a input type of url instead of the standard text. Firefox 4 will not submit the form without http:// or https:// in the input box.

All I'm after is a URL without the protocol such as www.google.com not http://www.google.com. Is there a parameter to do this or any other way (preferably without JavaScript)?

like image 252
hozza Avatar asked May 03 '11 20:05

hozza


1 Answers

use the html5 novalidate attribute on the form, e.g.

<form method="post" novalidate>
   ...
</form>

this will give you the nice keyboard on mobile devices and let you do your own validation

https://www.w3.org/TR/html5/sec-forms.html#element-attrdef-form-novalidate

like image 55
schpet Avatar answered Oct 15 '22 23:10

schpet