Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

バリデーションのmin/maxルールで、先頭が数字だと以降に数字以外の文字列を含んでいてもバリデーションエラーにならない #547

Closed
mtakeuchi opened this issue Mar 3, 2016 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@mtakeuchi
Copy link
Contributor

@mtakeuchi mtakeuchi commented Mar 3, 2016

数字以外の文字を含んでいる時点で、バリデーションエラーとなるはず。

サンプルコード

var logic = h5.core.logic(h5.validation.FormValidationLogic)
logic.addRule({ check1: { min: 5 } });

var result = logic.validate({ check1: "6" }); // result.isValid = true
var result = logic.validate({ check1: "6a" }); // result.isValid = true になってしまう。

version 1.2.2

tom75s added a commit that referenced this issue Jun 27, 2016
値をルールに適した型へ変換するとき、Number型かどうかの判定を追加しました。
@simdy simdy added the bug label Jun 27, 2016
@simdy simdy added this to the v1.2.3 milestone Jun 27, 2016
tom75s added a commit that referenced this issue Jun 27, 2016
また、isNumberValue関数がh5.core.data.jsと重複して定義しているので、
内部モジュールとして分離する旨のTODOコメントを追記。
@simdy simdy closed this Jun 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.