Browse Source

#19: Update the demo to illustrate select box validator

nghuuphuoc 12 years ago
parent
commit
45f8c763fa
2 changed files with 24 additions and 1 deletions
  1. 1 1
      CHANGELOG.md
  2. 23 0
      demo/validators.html

+ 1 - 1
CHANGELOG.md

@@ -3,7 +3,7 @@
 v0.1.1
 * #16: Disable client side validation in HTML 5
 * #17: Support default Bootstrap form without labels
-* #18: Support select box validator
+* #19: Support select box validator
 
 v0.1.0 (2013-10-14)
 * First release

+ 23 - 0
demo/validators.html

@@ -32,6 +32,22 @@
                             </div>
 
                             <div class="form-group">
+                                <label class="col-lg-3 control-label">Country</label>
+                                <div class="col-lg-5">
+                                    <select class="form-control" name="country">
+                                        <option value="">-- Select a country --</option>
+                                        <option value="fr">France</option>
+                                        <option value="de">Germany</option>
+                                        <option value="it">Italy</option>
+                                        <option value="jp">Japan</option>
+                                        <option value="ru">Russia</option>
+                                        <option value="gb">United Kingdom</option>
+                                        <option value="us">United State</option>
+                                    </select>
+                                </div>
+                            </div>
+
+                            <div class="form-group">
                                 <div class="col-lg-9 col-lg-offset-3">
                                     <div class="checkbox">
                                         <input type="checkbox" name="acceptTerms" /> Accept the terms and policies
@@ -142,6 +158,13 @@ $(document).ready(function() {
                     }
                 }
             },
+            country: {
+                validators: {
+                    notEmpty: {
+                        message: 'The country is required and can\'t be empty'
+                    }
+                }
+            },
             acceptTerms: {
                 validators: {
                     notEmpty: {