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

バリデーションのNullチェックについて #579

Open
goofmint opened this issue Aug 10, 2016 · 1 comment
Open

バリデーションのNullチェックについて #579

goofmint opened this issue Aug 10, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@goofmint
Copy link

Nullかどうかの検証を行う際に、

<input id="assertNull2" name="assertNull" type="radio" data-nul /> 選択不可2

のようにnulとしないと発動しません(lが一つない)。が、実際の入力値の検証では

指定されたルールnulは未定義です

というメッセージがconsoleに出ます。

コードで、

this._formController.addRule({
  assertNull: {
    assertNull: true
  }
});

とした場合は正しく動きます。

@simdy simdy added this to the v1.2.4 milestone Aug 18, 2016
@simdy simdy added the bug label Aug 18, 2016
@tkmHashi
Copy link
Contributor

調査報告

  • h5.ui.FormController.js:l.86
    #519の修正でデフォルトメッセージの定義をnulからassertNull,notNullからassertNotNullに変更された。
  • h5.ui.FormController.js:l.1459
    data-*属性で指定できるルールはnul,notNullと定義されている。
  • h5.validation.js:l.655
    ルールに基づいたバリデーション関数名はassertNull,assertNotNullと定義されている。

data-*属性で指定できるルールをキーとしてバリデーション関数を呼び出す。
したがって、ルールnulをキーとしてバリデーション関数を呼び出そうとしてもnul関数が存在しないので「指定されたルールnulは未定義です」となる。

対応策
data-*属性で指定できるルール と ルールに基づいたバリデーション関数名を一致させる修正をする必要がある。

@simdy simdy modified the milestones: v1.3.2, upcoming Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants