浏览代码

#12: notEmpty validator must support radio elements

phuoc 12 年之前
父节点
当前提交
07bacd835a
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      README.md
  2. 1 1
      src/js/bootstrapvalidate.js

+ 1 - 1
README.md

@@ -67,7 +67,7 @@ Below is the list of built-in validators sorted in alphabetical order:
 
 
 Validator name                            | Description
 Validator name                            | Description
 ------------------------------------------|------------
 ------------------------------------------|------------
-[between](docs/between/README.md)         | Checks if the input value is between (strictly or not) two given numbers
+[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
 digits                                    | Return true if the value contains only digits
 emailAddress                              | Validate an email address
 emailAddress                              | Validate an email address
 greaterThan                               | Return true if the value is greater than or equals to given number
 greaterThan                               | Return true if the value is greater than or equals to given number

+ 1 - 1
src/js/bootstrapvalidate.js

@@ -79,7 +79,7 @@
                 var that         = this,
                 var that         = this,
                     fieldElement = $(foundFields[0]),
                     fieldElement = $(foundFields[0]),
                     type         = $(fieldElement).attr('type'),
                     type         = $(fieldElement).attr('type'),
-                    event        = ('checkbox' == type) ? 'change' : 'keyup';
+                    event        = ('checkbox' == type || 'radio' == type) ? 'change' : 'keyup';
 
 
                 $(fieldElement)
                 $(fieldElement)
                     .on(event, function() {
                     .on(event, function() {