Getting Started
Getting used with FormValidation
What's included?
The FormValidation package consists of the following files:
formvalidation/
├── dist
│ ├── css
│ │ └── formValidation( .min) .css
│ │
│ └── js
│ ├── framework
│ │ ├── bootstrap( .min) .js
│ │ ├── bootstrap4( .min) .js
│ │ ├── foundation( .min) .js
│ │ ├── foundation5( .min) .js
│ │ ├── pure( .min) .js
│ │ ├── semantic( .min) .js
│ │ └── uikit( .min) .js
│ │
│ ├── language
│ │ ├── de_DE.js
│ │ ├── en_US.js
│ │ └── ...
│ │
│ ├── formValidation( .min) .js
│ └── formValidation.popular( .min) .js
│
└── src
├── css
│ ├── framework
│ │ ├── bootstrap.css
│ │ ├── foundation.css
│ │ ├── pure.css
│ │ ├── semantic.css
│ │ └── uikit.css
│ │
│ ├── base.css
│ └── formValidation.css
│
└── js
├── framework
│ ├── bootstrap.js
│ ├── foundation.js
│ ├── pure.js
│ ├── semantic.js
│ └── uikit.js
│
├── language
│ ├── de_DE.js
│ ├── en_US.js
│ └── ...
│
├── validator
│ ├── base64.js
│ ├── between.js
│ ├── callback.js
│ └── ...
│
├── base.js // The main plugin source file containing the base class
└── helper.js // Helper class
The src
directory consists of the original source files. Meanwhile, the
dist
directory consists of files which is combined and compressed. It
should be used in the production site.
Directory
Description
dist/css
src/css
Consists of CSS file that defines CSS classes for styling elements
dist/js/framework
src/js/framework
Consists of Javascript files that support specific framework. You only
need to include one file associating with current used framework
dist/js/language
stc/js/language
The language packages that provide the default error messages
src/js/validator
Consists of built-in validators
dist/js/formValidation(.min).js
already include all built-in validators.
dist/js/formValidation.popular(.min).js
only consists of most popular
validators. This file might be used on a heavy site with needed validators only.
Language packages
FormValidation has been translated into the following languages, which are also available
in both src/language
and dist/language
directories:
If you wonder how to use the language package, then
this
example is exactly for you
Usage
It takes only 3 steps to use the plugin:
Including library
Choose the framework you are using to see CSS, Javascript files that need to be
included in your page (Assuming frameworks and FormValidation are placed in the
vendor
directory. You might need change the path to these files)
FormValidation requires
jQuery v1.9.1 or higher
<!-- Bootstrap CSS v3 -->
< link rel = "stylesheet" href = "/vendor/bootstrap/css/bootstrap.min.css" >
<!-- FormValidation CSS file -->
< link rel = "stylesheet" href = "/vendor/formvalidation/dist/css/formValidation.min.css" >
<!-- jQuery v1.9.1 or higher -->
< script src = "/vendor/jquery/jquery.min.js" ></ script >
<!-- Bootstrap JS -->
< script src = "/vendor/bootstrap/js/bootstrap.min.js" ></ script >
<!-- FormValidation plugin and the class supports validating Bootstrap form -->
< script src = "/vendor/formvalidation/dist/js/formValidation.min.js" ></ script >
< script src = "/vendor/formvalidation/dist/js/framework/bootstrap.min.js" ></ script >
Don't confuse bootstrap(.min).js file provided by the Bootstrap
framework with bootstrap(.min).js provided by FormValidation which
is placed inside the formvalidation/dist/js/framework directory.
They are two different files and both of them need to be included as
mentioned above.
<!-- Bootstrap CSS v4.0.0 (alpha 3) -->
< link rel = "stylesheet" href = "/vendor/bootstrap/css/bootstrap.min.css" >
<!-- FormValidation CSS file -->
< link rel = "stylesheet" href = "/vendor/formvalidation/dist/css/formValidation.min.css" >
<!-- jQuery v1.9.1 or higher -->
< script src = "/vendor/jquery/jquery.min.js" ></ script >
<!-- Tether library, which is required if you want to use Bootstrap tooltip -->
< script src = "/vendor/tether/js/tether.min.js" ></ script >
<!-- Bootstrap JS -->
< script src = "/vendor/bootstrap/js/bootstrap.min.js" ></ script >
<!-- FormValidation plugin and the class supports validating Bootstrap form -->
< script src = "/vendor/formvalidation/dist/js/formValidation.min.js" ></ script >
< script src = "/vendor/formvalidation/dist/js/framework/bootstrap4.min.js" ></ script >
Don't confuse bootstrap(.min).js file provided by the Bootstrap
framework with bootstrap4(.min).js provided by FormValidation which
is placed inside the formvalidation/dist/js/framework directory.
They are two different files and both of them need to be included as
mentioned above.
<!-- Foundation v5 CSS -->
< link rel = "stylesheet" href = "/vendor/foundation/css/normalize.min.css" >
< link rel = "stylesheet" href = "/vendor/foundation/css/foundation.min.css" >
<!-- FormValidation CSS file -->
< link rel = "stylesheet" href = "/vendor/formvalidation/dist/css/formValidation.min.css" >
<!-- jQuery v1.9.1 or higher -->
< script src = "/vendor/jquery/jquery.min.js" ></ script >
<!-- Foundation JS file -->
< script src = "/vendor/foundation/js/vendor/modernizr.js" ></ script >
< script src = "/vendor/foundation/js/foundation/foundation.js" ></ script >
< script src = "/vendor/foundation/js/foundation/foundation.tooltip.js" ></ script >
<!-- FormValidation plugin and the class supports validating Foundation form -->
< script src = "/vendor/formvalidation/dist/js/formValidation.min.js" ></ script >
< script src = "/vendor/formvalidation/dist/js/framework/foundation5.min.js" ></ script >
Don't confuse foundation(.min).js file provided by the Foundation
framework with foundation5(.min).js provided by FormValidation which
is placed inside the formvalidation/dist/js/framework directory.
They are two different files and both of them need to be included as
mentioned above.
<!-- Foundation v6 CSS -->
< link rel = "stylesheet" href = "/vendor/foundation/css/foundation.min.css" >
<!-- FormValidation CSS file -->
< link rel = "stylesheet" href = "/vendor/formvalidation/dist/css/formValidation.min.css" >
<!-- jQuery v1.9.1 or higher -->
< script src = "/vendor/jquery/jquery.min.js" ></ script >
<!-- Foundation JS file -->
< script src = "/vendor/foundation/js/foundation/foundation.min.js" ></ script >
<!-- FormValidation plugin and the class supports validating Foundation form -->
< script src = "/vendor/formvalidation/dist/js/formValidation.min.js" ></ script >
< script src = "/vendor/formvalidation/dist/js/framework/foundation.min.js" ></ script >
Don't confuse foundation(.min).js file provided by the Foundation
framework with foundation(.min).js provided by FormValidation which
is placed inside the formvalidation/dist/js/framework directory.
They are two different files and both of them need to be included as
mentioned above.
<!-- Pure CSS -->
< link rel = "stylesheet" href = "/vendor/pure/pure-min.css" >
<!--[if lte IE 8]><link rel="stylesheet" href="/vendor/pure/grids-responsive-old-ie-min.css"><![endif]-->
<!--[if gt IE 8]><!--> < link rel = "stylesheet" href = "/vendor/pure/grids-responsive-min.css" > <!--<![endif]-->
<!-- FormValidation CSS file -->
< link rel = "stylesheet" href = "/vendor/formvalidation/dist/css/formValidation.min.css" >
<!-- jQuery v1.9.1 or higher -->
< script src = "/vendor/jquery/jquery.min.js" ></ script >
<!-- FormValidation plugin and the class supports validating Pure form -->
< script src = "/vendor/formvalidation/dist/js/formValidation.min.js" ></ script >
< script src = "/vendor/formvalidation/dist/js/framework/pure.min.js" ></ script >
<!-- Semantic CSS -->
< link rel = "stylesheet" href = "/vendor/semantic-ui/semantic.min.css" >
<!-- FormValidation CSS file -->
< link rel = "stylesheet" href = "/vendor/formvalidation/dist/css/formValidation.min.css" >
<!-- jQuery v1.9.1 or higher -->
< script src = "/vendor/jquery/jquery.min.js" ></ script >
<!-- Semantic JS -->
< script src = "/vendor/semantic-ui/semantic.min.js" ></ script >
<!-- FormValidation plugin and the class supports validating Semantic form -->
< script src = "/vendor/formvalidation/dist/js/formValidation.min.js" ></ script >
< script src = "/vendor/formvalidation/dist/js/framework/semantic.min.js" ></ script >
Don't confuse semantic(.min).js file provided by the Semantic
framework with semantic(.min).js provided by FormValidation which is
placed inside the formvalidation/dist/js/framework directory.
They are two different files and both of them need to be included as
mentioned above.
<!-- UIKit CSS -->
< link rel = "stylesheet" href = "/vendor/uikit/css/uikit.min.css" >
<!-- FormValidation CSS file -->
< link rel = "stylesheet" href = "/vendor/formvalidation/dist/css/formValidation.min.css" >
<!-- jQuery v1.9.1 or higher -->
< script src = "/vendor/jquery/jquery.min.js" ></ script >
<!-- UIKit JS -->
< script src = "/vendor/uikit/js/uikit.min.js" ></ script >
<!-- FormValidation plugin and the class supports validating Semantic form -->
< script src = "/vendor/formvalidation/dist/js/formValidation.min.js" ></ script >
< script src = "/vendor/formvalidation/dist/js/framework/uikit.min.js" ></ script >
Don't confuse uikit(.min).js file provided by the UIKit framework
with uikit(.min).js provided by FormValidation which is placed
inside the formvalidation/dist/js/framework directory.
They are two different files and both of them need to be included as
mentioned above.
If you want to use the default message translated in the language package , then finally include it:
< script src = "/vendor/formvalidation/dist/js/language/languagecode_COUNTRYCODE.js" ></ script >
You don't need to require the English package
because it is already included in the plugin. The package is available here just
for translating into other languages.
The CSS and Javascript files for each framework can be downloaded directly from their
official website or from CDN:
Writing form
If your form does NOT follow the format shown in the next section, you will see the
following error in the Console window of browser:
// Chrome
Uncaught RangeError: Maximum call stack size exceeded
// Firefox
Too much recursion error
For complex form, use the
row option
Do NOT use name="submit" or id="submit"
attribute for the submit button. Otherwise, the form
can't be submitted after
validation
The plugin supports all possible kind of forms, including:
Stacked form
Stacked form without labels
Inline form
Horizontal form
Complex form
It also supports multiple fields on the same row via the row option:
Calling plugin
Call the plugin to validate the form as following:
$ ( document ). ready ( function () {
$ ( formSelector ). formValidation ({
// Indicate the framework
// Can be bootstrap, foundation, pure, semantic, uikit
framework : '...' ,
// Other settings
excluded : ...,
icon : ...,
message : 'This value is not valid' ,
trigger : null ,
fields : ...
});
});
For example, to validate a sample signing in form with username and password fields,
the plugin might be called as:
$ ( document ). ready ( function () {
$ ( '#signinForm' ). formValidation ({
// I am validating Bootstrap form
framework : 'bootstrap' ,
// Feedback icons
icon : {
valid : 'glyphicon glyphicon-ok' ,
invalid : 'glyphicon glyphicon-remove' ,
validating : 'glyphicon glyphicon-refresh'
},
// List of fields and their validation rules
fields : {
username : {
validators : {
notEmpty : {
message : 'The username is required and cannot be empty'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_]+$/ ,
message : 'The username can only consist of alphabetical, number and underscore'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required and cannot be empty'
}
}
}
}
});
});
Look at the Settings page to see the meaning of plugin
options.
Example
Below is a classical registration form covering all the steps you've just seen above:
< form id = "registrationForm" class = "form-horizontal" >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Full name</ label >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "firstName" placeholder = "First name" />
</ div >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "lastName" placeholder = "Last name" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Username</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "username" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Email address</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "email" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Password</ label >
< div class = "col-xs-5" >
< input type = "password" class = "form-control" name = "password" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Gender</ label >
< div class = "col-xs-5" >
< div class = "radio" >
< label >
< input type = "radio" name = "gender" value = "male" /> Male
</ label >
</ div >
< div class = "radio" >
< label >
< input type = "radio" name = "gender" value = "female" /> Female
</ label >
</ div >
< div class = "radio" >
< label >
< input type = "radio" name = "gender" value = "other" /> Other
</ label >
</ div >
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Date of birth</ label >
< div class = "col-xs-3" >
< input type = "text" class = "form-control" name = "birthday" placeholder = "YYYY/MM/DD" />
</ div >
</ div >
< div class = "form-group" >
< div class = "col-xs-9 col-xs-offset-3" >
< button type = "submit" class = "btn btn-primary" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ({
framework : 'bootstrap' ,
icon : {
valid : 'glyphicon glyphicon-ok' ,
invalid : 'glyphicon glyphicon-remove' ,
validating : 'glyphicon glyphicon-refresh'
},
fields : {
firstName : {
row : '.col-xs-4' ,
validators : {
notEmpty : {
message : 'The first name is required'
}
}
},
lastName : {
row : '.col-xs-4' ,
validators : {
notEmpty : {
message : 'The last name is required'
}
}
},
username : {
validators : {
notEmpty : {
message : 'The username is required'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_\.]+$/ ,
message : 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The input is not a valid email address'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
},
different : {
field : 'username' ,
message : 'The password cannot be the same as username'
}
}
},
gender : {
validators : {
notEmpty : {
message : 'The gender is required'
}
}
},
birthday : {
validators : {
notEmpty : {
message : 'The date of birth is required'
},
date : {
format : 'YYYY/MM/DD' ,
message : 'The date of birth is not valid'
}
}
}
}
});
});
</ script >
< form id = "registrationForm" >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Full name</ label >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "firstName" placeholder = "First name" />
</ div >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "lastName" placeholder = "Last name" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Username</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "username" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Email address</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "email" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Password</ label >
< div class = "col-xs-5" >
< input type = "password" class = "form-control" name = "password" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3" > Gender</ label >
< div class = "col-xs-5" >
< div class = "form-check" >
< label class = "form-check-label" >
< input class = "form-check-input" type = "radio" name = "gender" value = "male" /> Male
</ label >
</ div >
< div class = "form-check" >
< label class = "form-check-label" >
< input class = "form-check-input" type = "radio" name = "gender" value = "female" /> Female
</ label >
</ div >
< div class = "form-check" >
< label class = "form-check-label" >
< input class = "form-check-input" type = "radio" name = "gender" value = "other" /> Other
</ label >
</ div >
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Date of birth</ label >
< div class = "col-xs-3" >
< input type = "text" class = "form-control" name = "birthday" placeholder = "YYYY/MM/DD" />
</ div >
</ div >
< div class = "form-group row" >
< div class = "col-xs-9 offset-xs-3" >
< button type = "submit" class = "btn btn-primary" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ({
framework : 'bootstrap4' ,
icon : {
valid : 'fa fa-check' ,
invalid : 'fa fa-times' ,
validating : 'fa fa-refresh'
},
fields : {
firstName : {
row : '.col-xs-4' ,
validators : {
notEmpty : {
message : 'The first name is required'
}
}
},
lastName : {
row : '.col-xs-4' ,
validators : {
notEmpty : {
message : 'The last name is required'
}
}
},
username : {
validators : {
notEmpty : {
message : 'The username is required'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_\.]+$/ ,
message : 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The input is not a valid email address'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
},
different : {
field : 'username' ,
message : 'The password cannot be the same as username'
}
}
},
gender : {
validators : {
notEmpty : {
message : 'The gender is required'
}
}
},
birthday : {
validators : {
notEmpty : {
message : 'The date of birth is required'
},
date : {
format : 'YYYY/MM/DD' ,
message : 'The date of birth is not valid'
}
}
}
}
});
});
</ script >
< form id = "registrationForm" class = "fv-form-horizontal" >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Full name</ label >
</ div >
< div class = "small-9 columns" >
< div class = "row" >
< div class = "small-6 columns" >
< input type = "text" name = "firstName" placeholder = "First name" />
</ div >
< div class = "small-6 columns" >
< input type = "text" name = "lastName" placeholder = "Last name" />
</ div >
</ div >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Username</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "username" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Email address</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "email" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Password</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "password" name = "password" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right" > Gender</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "radio" name = "gender" value = "male" />< label > Male</ label >
< input type = "radio" name = "gender" value = "female" />< label > Female</ label >
< input type = "radio" name = "gender" value = "other" />< label > Other</ label >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Date of birth</ label >
</ div >
< div class = "small-4 small-pull-5 columns" >
< input type = "text" name = "birthday" />
</ div >
</ div >
< div class = "row" >
< div class = "small-9 small-push-3 columns" >
< button type = "submit" class = "button small" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ({
framework : 'foundation5' ,
icon : {
valid : 'fa fa-check' ,
invalid : 'fa fa-times' ,
validating : 'fa fa-refresh'
},
fields : {
firstName : {
row : '.small-6' ,
validators : {
notEmpty : {
message : 'The first name is required'
}
}
},
lastName : {
row : '.small-6' ,
validators : {
notEmpty : {
message : 'The last name is required'
}
}
},
username : {
validators : {
notEmpty : {
message : 'The username is required'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_\.]+$/ ,
message : 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The input is not a valid email address'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
},
different : {
field : 'username' ,
message : 'The password cannot be the same as username'
}
}
},
gender : {
validators : {
notEmpty : {
message : 'The gender is required'
}
}
},
birthday : {
validators : {
notEmpty : {
message : 'The date of birth is required'
},
date : {
format : 'YYYY/MM/DD' ,
message : 'The date of birth is not valid'
}
}
}
}
});
});
</ script >
< form id = "registrationForm" >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Full name</ label >
</ div >
< div class = "small-9 columns" >
< div class = "row" >
< div class = "small-6 columns" >
< input type = "text" name = "firstName" placeholder = "First name" />
</ div >
< div class = "small-6 columns" >
< input type = "text" name = "lastName" placeholder = "Last name" />
</ div >
</ div >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Username</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "username" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Email address</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "email" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Password</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "password" name = "password" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right" > Gender</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "radio" name = "gender" value = "male" />< label > Male</ label >
< input type = "radio" name = "gender" value = "female" />< label > Female</ label >
< input type = "radio" name = "gender" value = "other" />< label > Other</ label >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Date of birth</ label >
</ div >
< div class = "small-4 small-pull-5 columns" >
< input type = "text" name = "birthday" />
</ div >
</ div >
< div class = "row" >
< div class = "small-9 small-push-3 columns" >
< button type = "submit" class = "button" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ({
framework : 'foundation' ,
icon : {
valid : 'fa fa-check' ,
invalid : 'fa fa-times' ,
validating : 'fa fa-refresh'
},
fields : {
firstName : {
row : '.small-6' ,
validators : {
notEmpty : {
message : 'The first name is required'
}
}
},
lastName : {
row : '.small-6' ,
validators : {
notEmpty : {
message : 'The last name is required'
}
}
},
username : {
validators : {
notEmpty : {
message : 'The username is required'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_\.]+$/ ,
message : 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The input is not a valid email address'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
},
different : {
field : 'username' ,
message : 'The password cannot be the same as username'
}
}
},
gender : {
validators : {
notEmpty : {
message : 'The gender is required'
}
}
},
birthday : {
validators : {
notEmpty : {
message : 'The date of birth is required'
},
date : {
format : 'YYYY/MM/DD' ,
message : 'The date of birth is not valid'
}
}
}
}
});
});
</ script >
< form id = "registrationForm" class = "pure-form pure-form-aligned" >
< div class = "pure-control-group" >
< label > Full name</ label >
< input name = "firstName" type = "text" placeholder = "First name" />
</ div >
< div class = "pure-control-group" >
< label ></ label >
< input name = "lastName" type = "text" placeholder = "Last name" />
</ div >
< div class = "pure-control-group" >
< label > Username</ label >
< input name = "username" type = "text" placeholder = "Username" />
</ div >
< div class = "pure-control-group" >
< label > Email address</ label >
< input name = "email" type = "text" placeholder = "Email address" />
</ div >
< div class = "pure-control-group" >
< label > Password</ label >
< input name = "password" type = "password" placeholder = "Password" />
</ div >
< div class = "pure-control-group" >
< label > Gender</ label >
< input name = "gender" type = "radio" value = "male" /> Male< br />
< label ></ label >
< input name = "gender" type = "radio" value = "female" /> Female< br />
< label ></ label >
< input name = "gender" type = "radio" value = "other" /> Other< br />
</ div >
< div class = "pure-control-group" >
< label > Date of birth</ label >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD" />
</ div >
< div class = "pure-control-group" >
< label ></ label >
< button type = "submit" class = "pure-button pure-button-primary" > Submit</ button >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ({
framework : 'pure' ,
icon : {
valid : 'fa fa-check' ,
invalid : 'fa fa-times' ,
validating : 'fa fa-refresh'
},
fields : {
firstName : {
validators : {
notEmpty : {
message : 'The first name is required'
}
}
},
lastName : {
validators : {
notEmpty : {
message : 'The last name is required'
}
}
},
username : {
validators : {
notEmpty : {
message : 'The username is required'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_\.]+$/ ,
message : 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The input is not a valid email address'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
},
different : {
field : 'username' ,
message : 'The password cannot be the same as username'
}
}
},
gender : {
validators : {
notEmpty : {
message : 'The gender is required'
}
}
},
birthday : {
validators : {
notEmpty : {
message : 'The date of birth is required'
},
date : {
format : 'YYYY/MM/DD' ,
message : 'The date of birth is not valid'
}
}
}
}
});
});
</ script >
< form id = "registrationForm" class = "ui grid form fv-form-horizontal" >
< div class = "row field" >
< label class = "four wide column" > Full name</ label >
< div class = "six wide column" >
< div class = "ui input icon" >
< input name = "firstName" type = "text" placeholder = "First name" />
</ div >
</ div >
< div class = "six wide column" >
< div class = "ui input icon" >
< input name = "lastName" type = "text" placeholder = "Last name" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Username</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< input name = "username" type = "text" placeholder = "Username" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Email address</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< input name = "email" type = "text" placeholder = "Email address" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Password</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< input name = "password" type = "password" placeholder = "Password" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Gender</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< div class = "ui radio checkbox" >
< input name = "gender" type = "radio" value = "male" /> < label > Male</ label >
</ div >
< div class = "ui radio checkbox" >
< input name = "gender" type = "radio" value = "female" /> < label > Female</ label >
</ div >
< div class = "ui radio checkbox" >
< input name = "gender" type = "radio" value = "other" /> < label > Other</ label >
</ div >
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Date of birth</ label >
< div class = "four wide column" >
< div class = "ui input icon" >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD" />
</ div >
</ div >
</ div >
< div class = "row" >
< label class = "four wide column" ></ label >
< div class = "eight wide column" >
<!-- Do NOT use name="submit" or id="submit" for the Submit button -->
< button type = "submit" class = "ui primary button" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ({
framework : 'semantic' ,
icon : {
valid : 'checkmark icon' ,
invalid : 'remove icon' ,
validating : 'refresh icon'
},
fields : {
firstName : {
validators : {
notEmpty : {
message : 'The first name is required'
}
}
},
lastName : {
validators : {
notEmpty : {
message : 'The last name is required'
}
}
},
username : {
validators : {
notEmpty : {
message : 'The username is required'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_\.]+$/ ,
message : 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The input is not a valid email address'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
},
different : {
field : 'username' ,
message : 'The password cannot be the same as username'
}
}
},
gender : {
validators : {
notEmpty : {
message : 'The gender is required'
}
}
},
birthday : {
validators : {
notEmpty : {
message : 'The date of birth is required'
},
date : {
format : 'YYYY/MM/DD' ,
message : 'The date of birth is not valid'
}
}
}
}
});
});
</ script >
< form id = "registrationForm" class = "uk-form uk-form-horizontal" >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Full name</ label >
< div class = "uk-form-controls" >
< div class = "uk-grid" >
< div class = "uk-width-1-2" >
< input class = "uk-width-1-1" name = "firstName" type = "text" placeholder = "First name" />
</ div >
< div class = "uk-width-1-2" >
< input class = "uk-width-1-1" name = "lastName" type = "text" placeholder = "Last name" />
</ div >
</ div >
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Username</ label >
< div class = "uk-form-controls" >
< input name = "username" type = "text" placeholder = "Username" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Email address</ label >
< div class = "uk-form-controls" >
< input name = "email" type = "text" placeholder = "Email address" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Password</ label >
< div class = "uk-form-controls" >
< input name = "password" type = "password" placeholder = "Password" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Gender</ label >
< div class = "uk-form-controls" >
< label >< input name = "gender" type = "radio" value = "male" /> Male</ label > < br />
< label >< input name = "gender" type = "radio" value = "female" /> Female</ label > < br />
< label >< input name = "gender" type = "radio" value = "other" /> Other</ label >
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Date of birth</ label >
< div class = "uk-form-controls" >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" ></ label >
< div class = "uk-form-controls" >
< button type = "submit" class = "uk-button uk-button-primary" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ({
framework : 'uikit' ,
icon : {
valid : 'uk-icon-check' ,
invalid : 'uk-icon-times' ,
validating : 'uk-icon-refresh'
},
fields : {
firstName : {
row : '.uk-width-1-2' ,
validators : {
notEmpty : {
message : 'The first name is required'
}
}
},
lastName : {
row : '.uk-width-1-2' ,
validators : {
notEmpty : {
message : 'The last name is required'
}
}
},
username : {
validators : {
notEmpty : {
message : 'The username is required'
},
stringLength : {
min : 6 ,
max : 30 ,
message : 'The username must be more than 6 and less than 30 characters long'
},
regexp : {
regexp : /^[a-zA-Z0-9_\.]+$/ ,
message : 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The input is not a valid email address'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
},
different : {
field : 'username' ,
message : 'The password cannot be the same as username'
}
}
},
gender : {
validators : {
notEmpty : {
message : 'The gender is required'
}
}
},
birthday : {
validators : {
notEmpty : {
message : 'The date of birth is required'
},
date : {
format : 'YYYY/MM/DD' ,
message : 'The date of birth is not valid'
}
}
}
}
});
});
</ script >
< form id = "registrationForm" class = "form-horizontal"
data-fv-framework = "bootstrap"
data-fv-icon-valid = "glyphicon glyphicon-ok"
data-fv-icon-invalid = "glyphicon glyphicon-remove"
data-fv-icon-validating = "glyphicon glyphicon-refresh" >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Full name</ label >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "firstName" placeholder = "First name"
data-fv-row = ".col-xs-4"
data-fv-notempty = "true"
data-fv-notempty-message = "The first name is required" />
</ div >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "lastName" placeholder = "Last name"
data-fv-row = ".col-xs-4"
data-fv-notempty = "true"
data-fv-notempty-message = "The last name is required" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Username</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "username"
data-fv-notempty = "true"
data-fv-notempty-message = "The username is required"
data-fv-stringlength = "true"
data-fv-stringlength-min = "6"
data-fv-stringlength-max = "30"
data-fv-stringlength-message = "The username must be more than 6 and less than 30 characters long"
data-fv-regexp = "true"
data-fv-regexp-regexp = "^[a-zA-Z0-9_\.]+$"
data-fv-regexp-message = "The username can only consist of alphabetical, number, dot and underscore" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Email address</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "email"
data-fv-notempty = "true"
data-fv-notempty-message = "The email address is required"
data-fv-emailaddress = "true"
data-fv-emailaddress-message = "The input is not a valid email address" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Password</ label >
< div class = "col-xs-5" >
< input type = "password" class = "form-control" name = "password"
data-fv-notempty = "true"
data-fv-notempty-message = "The password is required"
data-fv-different = "true"
data-fv-different-field = "username"
data-fv-different-message = "The password cannot be the same as username" />
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Gender</ label >
< div class = "col-xs-5" >
< div class = "radio" >
< label >
< input type = "radio" name = "gender" value = "male"
data-fv-notempty = "true"
data-fv-notempty-message = "The gender is required" /> Male
</ label >
</ div >
< div class = "radio" >
< label >
< input type = "radio" name = "gender" value = "female" /> Female
</ label >
</ div >
< div class = "radio" >
< label >
< input type = "radio" name = "gender" value = "other" /> Other
</ label >
</ div >
</ div >
</ div >
< div class = "form-group" >
< label class = "col-xs-3 control-label" > Date of birth</ label >
< div class = "col-xs-3" >
< input type = "text" class = "form-control" name = "birthday" placeholder = "YYYY/MM/DD"
data-fv-notempty = "true"
data-fv-notempty-message = "The date of birth is required"
data-fv-date = "true"
data-fv-date-format = "YYYY/MM/DD"
data-fv-date-message = "The date of birth is not valid" />
</ div >
</ div >
< div class = "form-group" >
< div class = "col-xs-9 col-xs-offset-3" >
< button type = "submit" class = "btn btn-primary" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ();
});
</ script >
< form id = "registrationForm"
data-fv-framework = "bootstrap4"
data-fv-icon-valid = "fa fa-check"
data-fv-icon-invalid = "fa fa-times"
data-fv-icon-validating = "fa fa-refresh" >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Full name</ label >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "firstName" placeholder = "First name"
data-fv-row = ".col-xs-4"
data-fv-notempty = "true"
data-fv-notempty-message = "The first name is required" />
</ div >
< div class = "col-xs-4" >
< input type = "text" class = "form-control" name = "lastName" placeholder = "Last name"
data-fv-row = ".col-xs-4"
data-fv-notempty = "true"
data-fv-notempty-message = "The last name is required" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Username</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "username"
data-fv-notempty = "true"
data-fv-notempty-message = "The username is required"
data-fv-stringlength = "true"
data-fv-stringlength-min = "6"
data-fv-stringlength-max = "30"
data-fv-stringlength-message = "The username must be more than 6 and less than 30 characters long"
data-fv-regexp = "true"
data-fv-regexp-regexp = "^[a-zA-Z0-9_\.]+$"
data-fv-regexp-message = "The username can only consist of alphabetical, number, dot and underscore" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Email address</ label >
< div class = "col-xs-5" >
< input type = "text" class = "form-control" name = "email"
data-fv-notempty = "true"
data-fv-notempty-message = "The email address is required"
data-fv-emailaddress = "true"
data-fv-emailaddress-message = "The input is not a valid email address" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Password</ label >
< div class = "col-xs-5" >
< input type = "password" class = "form-control" name = "password"
data-fv-notempty = "true"
data-fv-notempty-message = "The password is required"
data-fv-different = "true"
data-fv-different-field = "username"
data-fv-different-message = "The password cannot be the same as username" />
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3" > Gender</ label >
< div class = "col-xs-5" >
< div class = "form-check" >
< label class = "form-check-label" >
< input class = "form-check-input" type = "radio" name = "gender" value = "male"
data-fv-notempty = "true"
data-fv-notempty-message = "The gender is required" /> Male
</ label >
</ div >
< div class = "form-check" >
< label class = "form-check-label" >
< input class = "form-check-input" type = "radio" name = "gender" value = "female" /> Female
</ label >
</ div >
< div class = "form-check" >
< label class = "form-check-label" >
< input class = "form-check-input" type = "radio" name = "gender" value = "other" /> Other
</ label >
</ div >
</ div >
</ div >
< div class = "form-group row" >
< label class = "col-xs-3 col-form-label" > Date of birth</ label >
< div class = "col-xs-3" >
< input type = "text" class = "form-control" name = "birthday" placeholder = "YYYY/MM/DD"
data-fv-notempty = "true"
data-fv-notempty-message = "The date of birth is required"
data-fv-date = "true"
data-fv-date-format = "YYYY/MM/DD"
data-fv-date-message = "The date of birth is not valid" />
</ div >
</ div >
< div class = "form-group row" >
< div class = "col-xs-9 offset-xs-3" >
< button type = "submit" class = "btn btn-primary" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ();
});
</ script >
< form id = "registrationForm" class = "fv-form-horizontal"
data-fv-framework = "foundation5"
data-fv-icon-valid = "fa fa-check"
data-fv-icon-invalid = "fa fa-times"
data-fv-icon-validating = "fa fa-refresh" >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Full name</ label >
</ div >
< div class = "small-9 columns" >
< div class = "row" >
< div class = "small-6 columns" >
< input type = "text" name = "firstName" placeholder = "First name"
data-fv-row = ".small-6"
data-fv-notempty = "true"
data-fv-notempty-message = "The first name is required" />
</ div >
< div class = "small-6 columns" >
< input type = "text" name = "lastName" placeholder = "Last name"
data-fv-row = ".small-6"
data-fv-notempty = "true"
data-fv-notempty-message = "The last name is required" />
</ div >
</ div >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Username</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "username"
data-fv-notempty = "true"
data-fv-notempty-message = "The username is required"
data-fv-stringlength = "true"
data-fv-stringlength-min = "6"
data-fv-stringlength-max = "30"
data-fv-stringlength-message = "The username must be more than 6 and less than 30 characters long"
data-fv-regexp = "true"
data-fv-regexp-regexp = "^[a-zA-Z0-9_\.]+$"
data-fv-regexp-message = "The username can only consist of alphabetical, number, dot and underscore" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Email address</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "email"
data-fv-notempty = "true"
data-fv-notempty-message = "The email address is required"
data-fv-emailaddress = "true"
data-fv-emailaddress-message = "The input is not a valid email address" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Password</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "password" name = "password"
data-fv-notempty = "true"
data-fv-notempty-message = "The password is required"
data-fv-different = "true"
data-fv-different-field = "username"
data-fv-different-message = "The password cannot be the same as username" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right" > Gender</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "radio" name = "gender" value = "male"
data-fv-notempty = "true"
data-fv-notempty-message = "The gender is required" />< label > Male</ label >
< input type = "radio" name = "gender" value = "female" />< label > Female</ label >
< input type = "radio" name = "gender" value = "other" />< label > Other</ label >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "right inline" > Date of birth</ label >
</ div >
< div class = "small-4 small-pull-5 columns" >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD"
data-fv-notempty = "true"
data-fv-notempty-message = "The date of birth is required"
data-fv-date = "true"
data-fv-date-format = "YYYY/MM/DD"
data-fv-date-message = "The date of birth is not valid" />
</ div >
</ div >
< div class = "row" >
< div class = "small-9 small-push-3 columns" >
< button type = "submit" class = "button small" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ();
});
</ script >
< form id = "registrationForm"
data-fv-framework = "foundation"
data-fv-icon-valid = "fa fa-check"
data-fv-icon-invalid = "fa fa-times"
data-fv-icon-validating = "fa fa-refresh" >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Full name</ label >
</ div >
< div class = "small-9 columns" >
< div class = "row" >
< div class = "small-6 columns" >
< input type = "text" name = "firstName" placeholder = "First name"
data-fv-row = ".small-6"
data-fv-notempty = "true"
data-fv-notempty-message = "The first name is required" />
</ div >
< div class = "small-6 columns" >
< input type = "text" name = "lastName" placeholder = "Last name"
data-fv-row = ".small-6"
data-fv-notempty = "true"
data-fv-notempty-message = "The last name is required" />
</ div >
</ div >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Username</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "username"
data-fv-notempty = "true"
data-fv-notempty-message = "The username is required"
data-fv-stringlength = "true"
data-fv-stringlength-min = "6"
data-fv-stringlength-max = "30"
data-fv-stringlength-message = "The username must be more than 6 and less than 30 characters long"
data-fv-regexp = "true"
data-fv-regexp-regexp = "^[a-zA-Z0-9_\.]+$"
data-fv-regexp-message = "The username can only consist of alphabetical, number, dot and underscore" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Email address</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "text" name = "email"
data-fv-notempty = "true"
data-fv-notempty-message = "The email address is required"
data-fv-emailaddress = "true"
data-fv-emailaddress-message = "The input is not a valid email address" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Password</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "password" name = "password"
data-fv-notempty = "true"
data-fv-notempty-message = "The password is required"
data-fv-different = "true"
data-fv-different-field = "username"
data-fv-different-message = "The password cannot be the same as username" />
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right" > Gender</ label >
</ div >
< div class = "small-6 small-pull-3 columns" >
< input type = "radio" name = "gender" value = "male"
data-fv-notempty = "true"
data-fv-notempty-message = "The gender is required" />< label > Male</ label >
< input type = "radio" name = "gender" value = "female" />< label > Female</ label >
< input type = "radio" name = "gender" value = "other" />< label > Other</ label >
</ div >
</ div >
< div class = "row" >
< div class = "small-3 columns" >
< label class = "text-right middle" > Date of birth</ label >
</ div >
< div class = "small-4 small-pull-5 columns" >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD"
data-fv-notempty = "true"
data-fv-notempty-message = "The date of birth is required"
data-fv-date = "true"
data-fv-date-format = "YYYY/MM/DD"
data-fv-date-message = "The date of birth is not valid" />
</ div >
</ div >
< div class = "row" >
< div class = "small-9 small-push-3 columns" >
< button type = "submit" class = "button" name = "signup" value = "Sign up" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ();
});
</ script >
< form id = "registrationForm" class = "pure-form pure-form-aligned"
data-fv-framework = "pure"
data-fv-icon-valid = "fa fa-check"
data-fv-icon-invalid = "fa fa-times"
data-fv-icon-validating = "fa fa-refresh" >
< div class = "pure-control-group" >
< label > Full name</ label >
< input name = "firstName" type = "text" placeholder = "First name"
data-fv-notempty = "true"
data-fv-notempty-message = "The first name is required" />
</ div >
< div class = "pure-control-group" >
< label ></ label >
< input name = "lastName" type = "text" placeholder = "Last name"
data-fv-notempty = "true"
data-fv-notempty-message = "The last name is required" />
</ div >
< div class = "pure-control-group" >
< label > Username</ label >
< input name = "username" type = "text" placeholder = "Username"
data-fv-notempty = "true"
data-fv-notempty-message = "The username is required"
data-fv-stringlength = "true"
data-fv-stringlength-min = "6"
data-fv-stringlength-max = "30"
data-fv-stringlength-message = "The username must be more than 6 and less than 30 characters long"
data-fv-regexp = "true"
data-fv-regexp-regexp = "^[a-zA-Z0-9_\.]+$"
data-fv-regexp-message = "The username can only consist of alphabetical, number, dot and underscore" />
</ div >
< div class = "pure-control-group" >
< label > Email address</ label >
< input name = "email" type = "text" placeholder = "Email address"
data-fv-notempty = "true"
data-fv-notempty-message = "The email address is required"
data-fv-emailaddress = "true"
data-fv-emailaddress-message = "The input is not a valid email address" />
</ div >
< div class = "pure-control-group" >
< label > Password</ label >
< input name = "password" type = "password" placeholder = "Password"
data-fv-notempty = "true"
data-fv-notempty-message = "The password is required"
data-fv-different = "true"
data-fv-different-field = "username"
data-fv-different-message = "The password cannot be the same as username" />
</ div >
< div class = "pure-control-group" >
< label > Gender</ label >
< input name = "gender" type = "radio" value = "male"
data-fv-notempty = "true"
data-fv-notempty-message = "The gender is required" /> Male< br />
< label ></ label >
< input name = "gender" type = "radio" value = "female" /> Female< br />
< label ></ label >
< input name = "gender" type = "radio" value = "other" /> Other< br />
</ div >
< div class = "pure-control-group" >
< label > Date of birth</ label >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD"
data-fv-notempty = "true"
data-fv-notempty-message = "The date of birth is required"
data-fv-date = "true"
data-fv-date-format = "YYYY/MM/DD"
data-fv-date-message = "The date of birth is not valid" />
</ div >
< div class = "pure-control-group" >
< label ></ label >
< button type = "submit" class = "pure-button pure-button-primary" > Submit</ button >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ();
});
</ script >
< form id = "registrationForm" class = "ui grid form fv-form-horizontal"
data-fv-framework = "semantic"
data-fv-icon-valid = "checkmark icon"
data-fv-icon-invalid = "remove icon"
data-fv-icon-validating = "refresh icon" >
< div class = "row field" >
< label class = "four wide column" > Full name</ label >
< div class = "six wide column" >
< div class = "ui input icon" >
< input name = "firstName" type = "text" placeholder = "First name"
data-fv-notempty = "true"
data-fv-notempty-message = "The first name is required" />
</ div >
</ div >
< div class = "six wide column" >
< div class = "ui input icon" >
< input name = "lastName" type = "text" placeholder = "Last name"
data-fv-notempty = "true"
data-fv-notempty-message = "The last name is required" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Username</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< input name = "username" type = "text" placeholder = "Username"
data-fv-notempty = "true"
data-fv-notempty-message = "The username is required"
data-fv-stringlength = "true"
data-fv-stringlength-min = "6"
data-fv-stringlength-max = "30"
data-fv-stringlength-message = "The username must be more than 6 and less than 30 characters long"
data-fv-regexp = "true"
data-fv-regexp-regexp = "^[a-zA-Z0-9_\.]+$"
data-fv-regexp-message = "The username can only consist of alphabetical, number, dot and underscore" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Email address</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< input name = "email" type = "text" placeholder = "Email address"
data-fv-notempty = "true"
data-fv-notempty-message = "The email address is required"
data-fv-emailaddress = "true"
data-fv-emailaddress-message = "The input is not a valid email address" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Password</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< input name = "password" type = "password" placeholder = "Password"
data-fv-notempty = "true"
data-fv-notempty-message = "The password is required"
data-fv-different = "true"
data-fv-different-field = "username"
data-fv-different-message = "The password cannot be the same as username" />
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Gender</ label >
< div class = "eight wide column" >
< div class = "ui input icon" >
< div class = "ui radio checkbox" >
< input name = "gender" type = "radio" value = "male"
data-fv-notempty = "true"
data-fv-notempty-message = "The gender is required" /> < label > Male</ label >
</ div >
< div class = "ui radio checkbox" >
< input name = "gender" type = "radio" value = "female" /> < label > Female</ label >
</ div >
< div class = "ui radio checkbox" >
< input name = "gender" type = "radio" value = "other" /> < label > Other</ label >
</ div >
</ div >
</ div >
</ div >
< div class = "row field" >
< label class = "four wide column" > Date of birth</ label >
< div class = "four wide column" >
< div class = "ui input icon" >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD"
data-fv-notempty = "true"
data-fv-notempty-message = "The date of birth is required"
data-fv-date = "true"
data-fv-date-format = "YYYY/MM/DD"
data-fv-date-message = "The date of birth is not valid" />
</ div >
</ div >
</ div >
< div class = "row" >
< label class = "four wide column" ></ label >
< div class = "eight wide column" >
< button type = "submit" class = "ui primary button" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ();
});
</ script >
< form id = "registrationForm" class = "uk-form uk-form-horizontal"
data-fv-framework = "uikit"
data-fv-icon-valid = "uk-icon-check"
data-fv-icon-invalid = "uk-icon-times"
data-fv-icon-validating = "uk-icon-refresh" >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Full name</ label >
< div class = "uk-form-controls" >
< div class = "uk-grid" >
< div class = "uk-width-1-2" >
< input class = "uk-width-1-1" name = "firstName" type = "text" placeholder = "First name"
data-fv-row = ".uk-width-1-2"
data-fv-notempty = "true"
data-fv-notempty-message = "The first name is required" />
</ div >
< div class = "uk-width-1-2" >
< input class = "uk-width-1-1" name = "lastName" type = "text" placeholder = "Last name"
data-fv-row = ".uk-width-1-2"
data-fv-notempty = "true"
data-fv-notempty-message = "The last name is required" />
</ div >
</ div >
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Username</ label >
< div class = "uk-form-controls" >
< input name = "username" type = "text" placeholder = "Username"
data-fv-notempty = "true"
data-fv-notempty-message = "The username is required"
data-fv-stringlength = "true"
data-fv-stringlength-min = "6"
data-fv-stringlength-max = "30"
data-fv-stringlength-message = "The username must be more than 6 and less than 30 characters long"
data-fv-regexp = "true"
data-fv-regexp-regexp = "^[a-zA-Z0-9_\.]+$"
data-fv-regexp-message = "The username can only consist of alphabetical, number, dot and underscore" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Email address</ label >
< div class = "uk-form-controls" >
< input name = "email" type = "text" placeholder = "Email address"
data-fv-notempty = "true"
data-fv-notempty-message = "The email address is required"
data-fv-emailaddress = "true"
data-fv-emailaddress-message = "The input is not a valid email address" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Password</ label >
< div class = "uk-form-controls" >
< input name = "password" type = "password" placeholder = "Password"
data-fv-notempty = "true"
data-fv-notempty-message = "The password is required"
data-fv-different = "true"
data-fv-different-field = "username"
data-fv-different-message = "The password cannot be the same as username" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Gender</ label >
< div class = "uk-form-controls" >
< label >
< input name = "gender" type = "radio" value = "male"
data-fv-notempty = "true"
data-fv-notempty-message = "The gender is required" /> Male
</ label > < br />
< label >< input name = "gender" type = "radio" value = "female" /> Female</ label > < br />
< label >< input name = "gender" type = "radio" value = "other" /> Other</ label >
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" > Date of birth</ label >
< div class = "uk-form-controls" >
< input type = "text" name = "birthday" placeholder = "YYYY/MM/DD"
data-fv-notempty = "true"
data-fv-notempty-message = "The date of birth is required"
data-fv-date = "true"
data-fv-date-format = "YYYY/MM/DD"
data-fv-date-message = "The date of birth is not valid" />
</ div >
</ div >
< div class = "uk-form-row" >
< label class = "uk-form-label" ></ label >
< div class = "uk-form-controls" >
< button type = "submit" class = "uk-button uk-button-primary" > Submit</ button >
</ div >
</ div >
</ form >
< script >
$ ( document ). ready ( function () {
$ ( '#registrationForm' ). formValidation ();
});
</ script >