Skip to content

建议在Validator.element下获取Item的DOM元素 #46

@luffyfly

Description

@luffyfly

当页面上存在多个name相同的元素时,多个表单的validator之间会相互冲突。

https://github.com/aralejs/validator/blob/master/src/item.js#L24

var element = $(this.get('element')),
      type = element.attr('type'); 

将$(this.get('element'))改成类似与$(this.get('element'), validator.element)。

在富客户端程序中,经常有多个同类型的表单同时存在的情况,最好能避免相互之间的冲突。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions