Client & Server side validation for posts per page

closes #839

- caused a 500 error
This commit is contained in:
Hannah Wolfe 2013-09-19 07:55:37 +01:00
parent 477c4c59fa
commit 5528423636
2 changed files with 4 additions and 3 deletions

View File

@ -171,8 +171,8 @@
.check(email, {message: "Please supply a valid email address", el: $('#email-address')})
.isEmail().len(0, 254);
Ghost.Validate
.check(postsPerPage, {message: "Please use a number", el: $('postsPerPage')})
.isInt();
.check(postsPerPage, {message: "Please use a number less than 1000", el: $('postsPerPage')})
.isInt().max(1000);
if (Ghost.Validate._errors.length > 0) {
Ghost.Validate.handleErrors();

View File

@ -34,7 +34,8 @@
"defaultValue": "6",
"validations": {
"notNull": true,
"isNumeric": true
"isInt": true,
"max": 1000
}
},
"forceI18n": {