Browse Source

Update docs

phuoc 12 years ago
parent
commit
8587d77c4e
3 changed files with 41 additions and 54 deletions
  1. 41 19
      README.md
  2. 0 35
      docs/between/README.md
  3. BIN
      img/screenshot.png

+ 41 - 19
README.md

@@ -2,10 +2,6 @@
 
 
 A jQuery plugin to validate form fields. Use with Bootstrap 3
 A jQuery plugin to validate form fields. Use with Bootstrap 3
 
 
-The plugin uses [Bootstrap Tooltip](http://getbootstrap.com/javascript/#tooltips) to show the error message as following screenshot:
-
-![Bootstrap Validate screenshot](img/screenshot.png)
-
 ## Features
 ## Features
 
 
 * Many built-in [validators](#validators)
 * Many built-in [validators](#validators)
@@ -28,9 +24,11 @@ Since the BootstrapValidate plugin requires jQuery and Bootstrap 3, you have to
 
 
 ```html
 ```html
 <link rel="stylesheet" href="/path/to/bootstrap/css/bootstrap.css"/>
 <link rel="stylesheet" href="/path/to/bootstrap/css/bootstrap.css"/>
+<link rel="stylesheet" href="/path/to/bootstrapvalidate.min.css"/>
+
 <script type="text/javascript" src="/path/to/jquery/jquery-1.10.2.min.js"></script>
 <script type="text/javascript" src="/path/to/jquery/jquery-1.10.2.min.js"></script>
 <script type="text/javascript" src="/path/to/bootstrap/js/bootstrap.min.js"></script>
 <script type="text/javascript" src="/path/to/bootstrap/js/bootstrap.min.js"></script>
-<script type="text/javascript" src="/path/to/js/bootstrapvalidate.min.js"></script>
+<script type="text/javascript" src="/path/to/bootstrapvalidate.min.js"></script>
 ```
 ```
 
 
 Call the plugin to validate the form as following:
 Call the plugin to validate the form as following:
@@ -65,20 +63,42 @@ The ```<validatorName>``` can be the name of the built-in validator which are de
 
 
 Below is the list of built-in validators sorted in alphabetical order:
 Below is the list of built-in validators sorted in alphabetical order:
 
 
-Validator name          | Description
-------------------------|------------
-[between](docs/between) | Checks if the input value is between (strictly or not) two given numbers
-digits                  | Return true if the value contains only digits
-emailAddress            | Validate an email address
-greaterThan             | Return true if the value is greater than or equals to given number
-hexColor                | Validate a hex color
-identical               | Check if the value is the same as one of particular field
-lessThan                | Return true if the value is less than or equals to given number
-notEmpty                | Check if the value is empty
-regexp                  | Check if the value matches given Javascript regular expression
-stringLength            | Validate the length of a string
-uri                     | Validate an URL address
-usZipCode               | Validate a US zip code
+Validator name                | Description
+------------------------------|------------
+[between](#between-validator) | Checks if the input value is between (strictly or not) two given numbers
+digits                        | Return true if the value contains only digits
+emailAddress                  | Validate an email address
+greaterThan                   | Return true if the value is greater than or equals to given number
+hexColor                      | Validate a hex color
+identical                     | Check if the value is the same as one of particular field
+lessThan                      | Return true if the value is less than or equals to given number
+notEmpty                      | Check if the value is empty
+regexp                        | Check if the value matches given Javascript regular expression
+remote                        | Perform remote checking via Ajax request
+stringLength                  | Validate the length of a string
+uri                           | Validate an URL address
+usZipCode                     | Validate a US zip code
+
+### Between Validator
+
+```javascript
+$(document).ready(function() {
+    $(<form Selector>).bootstrapValidate({
+        fields: {
+            <fieldName>: {
+                validator: {
+                    between: {
+                        message: ...,   // [required] The error message
+                        min: ...        // [required] The lower value in the range
+                        max: ...,       // [required] The upper value in the range
+                        inclusive: ...  // [optional] Can be true or false. If true, the input value must be in the range strictly
+                    }
+                }
+            }
+        }
+    }
+});
+```
 
 
 ## Build
 ## Build
 
 
@@ -89,6 +109,8 @@ From the BootstrapValidate root directory, execute the following commands to ins
 ```bash
 ```bash
 $ npm install grunt --save-dev
 $ npm install grunt --save-dev
 $ npm install grunt-contrib-concat --save-dev
 $ npm install grunt-contrib-concat --save-dev
+$ npm install grunt-contrib-copy --save-dev
+$ npm install grunt-contrib-cssmin --save-dev
 $ npm install grunt-contrib-uglify --save-dev
 $ npm install grunt-contrib-uglify --save-dev
 $ npm install grunt-contrib-watch --save-dev
 $ npm install grunt-contrib-watch --save-dev
 ```
 ```

+ 0 - 35
docs/between/README.md

@@ -1,35 +0,0 @@
-# between Validator
-
-This validator checks if the input value is between (strictly or not) two given numbers
-
-## Usage
-
-```javascript
-$(document).ready(function() {
-    $(<form Selector>).bootstrapValidate({
-        fields: {
-            <fieldName>: {
-                validator: {
-                    between: {
-                        message: 'The input value is not between <min> and <max>',
-                        min: <min>,
-                        max: <max>,
-                        inclusive: true
-                    }
-                }
-            }
-        }
-    }
-});
-```
-
-## Options
-
-The ```between``` validator has the following options:
-
-Option name | Type    | Required | Default | Description
-------------|---------|----------|---------|------------
-message     | string  | Yes      | n/a     | The error message
-min         | int     | Yes      | n/a     | The lower value in the range
-max         | int     | Yes      | n/a     | The upper value in the range
-inclusive   | boolean | No       | false   | If true, the input value must be in the range strictly

BIN
img/screenshot.png