{"action":"closed","issue":{"url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/381","labels_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/381/comments","events_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/381/events","html_url":"https://github.com/aldeed/meteor-simple-schema/issues/381","id":88515611,"number":381,"title":"How  to manage an asyncronous `addValidator` for a namedContext?","user":{"login":"AlexFrazer","id":1350392,"avatar_url":"https://avatars.githubusercontent.com/u/1350392?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexFrazer","html_url":"https://github.com/AlexFrazer","followers_url":"https://api.github.com/users/AlexFrazer/followers","following_url":"https://api.github.com/users/AlexFrazer/following{/other_user}","gists_url":"https://api.github.com/users/AlexFrazer/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexFrazer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexFrazer/subscriptions","organizations_url":"https://api.github.com/users/AlexFrazer/orgs","repos_url":"https://api.github.com/users/AlexFrazer/repos","events_url":"https://api.github.com/users/AlexFrazer/events{/privacy}","received_events_url":"https://api.github.com/users/AlexFrazer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-15T19:21:30Z","updated_at":"2015-11-10T20:54:21Z","closed_at":"2015-11-10T20:54:21Z","body":"Let's say I wanted to validate my whole form, but needed to make a call to the back end to do it.\r\n\r\n> To add a custom validation function that is called for all keys for a specific SimpleSchema instance, use mySimpleSchema.addValidator(myFunction).\r\n\r\n```\r\n// validate an address by looking up the whole address through a meteor method\r\nAddressSchema.addValidator(function () {\r\n  Meteor.call('Address._validateAddress', this.value, function (err) {\r\n    // ???\r\n  });\r\n});\r\n```\r\n\r\nWhile the docs show how to use it for a single key, it doesn't seem very clear how to use it for an _entire form_. How would this be done?"}}