Skip to content

Commit

Permalink
add stringlength validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Carney Lau committed Jun 5, 2013
1 parent 12a8f94 commit a73377c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib.js
Expand Up @@ -248,7 +248,7 @@ var rigel = rigel || {};
* rule {minLength, maxLength, trim}
* @see StringLengthFieldValidator.java
*/
"stringLength": function (rule, value) {
"stringlength": function (rule, value) {
// if there is no value - don't do comparison
// if a value is required, a required validator should be added
value = modify(value, null);
Expand Down
2 changes: 1 addition & 1 deletion lib.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/tests.js
Expand Up @@ -114,13 +114,13 @@ test("validation email.", function(){
test("validation of stringlength, case", function(){
var rules = {
accName: {
stringLength : {maxLength: 10, minLength: 5,message: "accNameError" }
stringlength : {maxLength: 10, minLength: 5,message: "accNameError" }
},
sendMsg: {
stringLength : {maxLength: 10, minLength: 5, message: "sendMsg", trim: true}
stringlength : {maxLength: 10, minLength: 5, message: "sendMsg", trim: true}
},
sendLength: {
stringLength : {maxLength: 10, minLength: 5, message : "sendLength"}
stringlength : {maxLength: 10, minLength: 5, message : "sendLength"}
}
};

Expand Down

0 comments on commit a73377c

Please sign in to comment.