Browse Source

Enable feedback icons for all examples

nghuuphuoc 11 years ago
parent
commit
2848b1d8df
4 changed files with 46 additions and 8 deletions
  1. 30 6
      demo/index.html
  2. 5 0
      demo/labelWithoutClass.html
  3. 5 1
      demo/remote.html
  4. 6 1
      demo/validators.html

+ 30 - 6
demo/index.html

@@ -25,6 +25,16 @@
 
                     <form id="defaultForm" method="post" class="form-horizontal" action="target.php">
                         <div class="form-group">
+                            <label class="col-lg-3 control-label">Full name</label>
+                            <div class="col-lg-4">
+                                <input type="text" class="form-control" name="firstName" placeholder="First name" />
+                            </div>
+                            <div class="col-lg-4">
+                                <input type="text" class="form-control" name="lastName" placeholder="Last name" />
+                            </div>
+                        </div>
+
+                        <div class="form-group">
                             <label class="col-lg-3 control-label">Username</label>
                             <div class="col-lg-5">
                                 <input type="text" class="form-control" name="username" />
@@ -195,11 +205,25 @@ $(document).ready(function() {
             validating: 'glyphicon glyphicon-refresh'
         },
         fields: {
+            firstName: {
+                validators: {
+                    notEmpty: {
+                        message: 'The first name is required and cannot be empty'
+                    }
+                }
+            },
+            lastName: {
+                validators: {
+                    notEmpty: {
+                        message: 'The last name is required and cannot be empty'
+                    }
+                }
+            },
             username: {
                 message: 'The username is not valid',
                 validators: {
                     notEmpty: {
-                        message: 'The username is required and can\'t be empty'
+                        message: 'The username is required and cannot be empty'
                     },
                     stringLength: {
                         min: 6,
@@ -216,7 +240,7 @@ $(document).ready(function() {
 //                    },
                     different: {
                         field: 'password',
-                        message: 'The username and password can\'t be the same as each other'
+                        message: 'The username and password cannot be the same as each other'
                     }
                 }
             },
@@ -230,7 +254,7 @@ $(document).ready(function() {
             password: {
                 validators: {
                     notEmpty: {
-                        message: 'The password is required and can\'t be empty'
+                        message: 'The password is required and cannot be empty'
                     },
                     identical: {
                         field: 'confirmPassword',
@@ -238,14 +262,14 @@ $(document).ready(function() {
                     },
                     different: {
                         field: 'username',
-                        message: 'The password can\'t be the same as username'
+                        message: 'The password cannot be the same as username'
                     }
                 }
             },
             confirmPassword: {
                 validators: {
                     notEmpty: {
-                        message: 'The confirm password is required and can\'t be empty'
+                        message: 'The confirm password is required and cannot be empty'
                     },
                     identical: {
                         field: 'password',
@@ -253,7 +277,7 @@ $(document).ready(function() {
                     },
                     different: {
                         field: 'username',
-                        message: 'The password can\'t be the same as username'
+                        message: 'The password cannot be the same as username'
                     }
                 }
             },

+ 5 - 0
demo/labelWithoutClass.html

@@ -55,6 +55,11 @@
 $(document).ready(function() {
     $('#defaultForm').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',

+ 5 - 1
demo/remote.html

@@ -95,8 +95,12 @@
 $(document).ready(function() {
     $('#defaultForm').bootstrapValidator({
         message: 'This value is not valid',
-        feedbackIcons: true,
 //        live: 'disabled',
+        feedbackIcons: {
+            valid: 'glyphicon glyphicon-ok',
+            invalid: 'glyphicon glyphicon-remove',
+            validating: 'glyphicon glyphicon-refresh'
+        },
         fields: {
             username: {
                 message: 'The username is not valid',

+ 6 - 1
demo/validators.html

@@ -48,7 +48,7 @@
                             </div>
 
                             <div class="form-group">
-                                <div class="col-lg-9 col-lg-offset-3">
+                                <div class="col-lg-5 col-lg-offset-3">
                                     <div class="checkbox">
                                         <input type="checkbox" name="acceptTerms" /> Accept the terms and policies
                                     </div>
@@ -148,6 +148,11 @@
 $(document).ready(function() {
     $('#defaultForm').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',