{"action":"created","issue":{"url":"https://api.github.com/repos/meteortemplates/forms/issues/84","labels_url":"https://api.github.com/repos/meteortemplates/forms/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/meteortemplates/forms/issues/84/comments","events_url":"https://api.github.com/repos/meteortemplates/forms/issues/84/events","html_url":"https://github.com/meteortemplates/forms/issues/84","id":115037153,"number":84,"title":"this.field() in custom validation function returns undefined for value attribute","user":{"login":"danielparas","id":5887801,"avatar_url":"https://avatars.githubusercontent.com/u/5887801?v=3","gravatar_id":"","url":"https://api.github.com/users/danielparas","html_url":"https://github.com/danielparas","followers_url":"https://api.github.com/users/danielparas/followers","following_url":"https://api.github.com/users/danielparas/following{/other_user}","gists_url":"https://api.github.com/users/danielparas/gists{/gist_id}","starred_url":"https://api.github.com/users/danielparas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielparas/subscriptions","organizations_url":"https://api.github.com/users/danielparas/orgs","repos_url":"https://api.github.com/users/danielparas/repos","events_url":"https://api.github.com/users/danielparas/events{/privacy}","received_events_url":"https://api.github.com/users/danielparas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-04T11:55:37Z","updated_at":"2015-12-15T17:57:10Z","closed_at":null,"body":"Hi all, I'm trying to build a form that required password validation via password repeat/confirmation field. I'm having trouble with the custom validation for the password confirmation field as the `this.field('passwordNew').value` returns undefined constantly.\r\n\r\nSimple schema returned is as follows:\r\n\r\n```\r\n   ss = new SimpleSchema({\r\n      'passwordOld': {\r\n        type: String,\r\n        min: 6\r\n      },\r\n      'passwordNew': {\r\n        type: String,\r\n        min: 6\r\n      },\r\n      'passwordRepeat': {\r\n        type: String,\r\n        min: 6,\r\n        custom: function() {\r\n          if (this.value !== this.field('passwordNew').value) {\r\n            return \"passwordMismatch\";\r\n          }\r\n          return true;\r\n        }\r\n      }\r\n    });\r\n```\r\nI tried manually testing the validation to see if it's an issue with simple-schema but it is not as the validation worked fine with the following test code:\r\n\r\n```\r\n    ssContext = ss.namedContext(\"userForm\")\r\n    console.log ssContext.validate\r\n      'passwordOld' : 'testingtesting'\r\n      'passwordNew' : 'testtest'\r\n      'passwordRepeat' : 'testtest'\r\n```\r\n\r\nThis outputs `true` i.e. successful validation .. applying the same test data to the form fields results in a failed validation \"passwords do not match\"\r\n\r\nAny ideas how this can be solved please?\r\n\r\nThanks in advance for your input! Appreciate it.\r\n\r\nDan"},"comment":{"url":"https://api.github.com/repos/meteortemplates/forms/issues/comments/164841458","html_url":"https://github.com/meteortemplates/forms/issues/84#issuecomment-164841458","issue_url":"https://api.github.com/repos/meteortemplates/forms/issues/84","id":164841458,"user":{"login":"jonjamz","id":1040413,"avatar_url":"https://avatars.githubusercontent.com/u/1040413?v=3","gravatar_id":"","url":"https://api.github.com/users/jonjamz","html_url":"https://github.com/jonjamz","followers_url":"https://api.github.com/users/jonjamz/followers","following_url":"https://api.github.com/users/jonjamz/following{/other_user}","gists_url":"https://api.github.com/users/jonjamz/gists{/gist_id}","starred_url":"https://api.github.com/users/jonjamz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonjamz/subscriptions","organizations_url":"https://api.github.com/users/jonjamz/orgs","repos_url":"https://api.github.com/users/jonjamz/repos","events_url":"https://api.github.com/users/jonjamz/events{/privacy}","received_events_url":"https://api.github.com/users/jonjamz/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T17:57:10Z","updated_at":"2015-12-15T17:57:10Z","body":"On further testing, it turns out that the result from `this.field` is indeed undefined, even in the latest version of SimpleSchema. I've been looking through SimpleSchema code and am doing more testing."}}