dominar icon indicating copy to clipboard operation
dominar copied to clipboard

registerAsync example.

Open ovidius72 opened this issue 7 years ago • 0 comments

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

ovidius72 avatar Jun 30 '17 14:06 ovidius72