12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- $(document).ready(function () {
- $('#myModal').bootstrapValidator({
- message: 'This value is not valid',
- feedbackIcons: {
- valid: 'glyphicon glyphicon-ok',
- invalid: 'glyphicon glyphicon-remove',
- validating: 'glyphicon glyphicon-refresh'
- },
- fields: {
- username: {
- message: 'The username is not valid',
- validators: {
- notEmpty: {
- message: 'The username is required and can\'t 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, dot and underscore'
- }
- }
- },
- hobby: {
- validators: {
- notEmpty: {
- message: 'The country is required and can\'t be empty'
- }
- }
- },
- email: {
- validators: {
- notEmpty: {
- message: 'The email address is required and can\'t be empty'
- },
- emailAddress: {
- message: 'The input is not a valid email address'
- }
- }
- },
- phoneNumber: {
- validators: {
- phone: {
- message: 'The input is not a valid US phone number'
- }
- }
- },
- }
- });
- $("[data-toggle='popover']").popover();
- })
|