--- layout: default title: Playing with HTML 5 input types and attributes permalink: /examples/html5/ ---

Playing with HTML 5 input types and attributes

Examples

{% include share.html %}

FormValidation supports a few of HTML 5 types, attributes listed as following:

HTML 5 attribute Equivalent validator Equivalent HTML attribute
min="..." greaterThan validator {% highlight html %} data-fv-greaterthan="true" data-fv-greaterthan-value="..." {% endhighlight %}
max="..." lessThan validator {% highlight html %} data-fv-lessthan="true" data-fv-lessthan-value="..." {% endhighlight %}
maxlength="...", minlength="..." stringLength validator {% highlight html %} data-fv-stringlength="true" data-fv-stringlength-max="..." data-fv-stringlength-min="..." {% endhighlight %}
pattern="..." regexp validator {% highlight html %} data-fv-regexp="true" data-fv-regexp-regexp="..." {% endhighlight %}
required notEmpty validator data-fv-notempty="true"
type="color" color validator data-fv-hexcolor="true"
type="email" emailAddress validator data-fv-emailaddress="true"
{% highlight html %} type="range" min="..." max="..." {% endhighlight %} between validator {% highlight html %} data-fv-between="true" data-fv-between-min="..." data-fv-between-max="..." {% endhighlight %}
type="url" uri validator data-fv-uri="true"
{% include demo/tabs.html id="demo" frameworks="bootstrap" codes="programmatic" %}