Skip to content

registerAsync example. #31

@ovidius72

Description

@ovidius72

In the readme file the documentation for the registerAsync method is the following

Dominar.Validator.registerAsync('username_availability', function(username, attribute, parameters, passes) {.....}

I would like to pass some parameters to the newly registered method (username_availability in this example).
The parameter I want to pass is not a static one, such as min:3, instead it will be a dynamic value, for example additional info about the current user.

I was thinking to something like this, but it's not working. The user.email value is not passed:

fieldA { rule: 'username_availability:' + user.email }

Can you please explain me how I can do that, if possible ?
thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions