{"action":"created","issue":{"url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6796","labels_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6796/labels{/name}","comments_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6796/comments","events_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6796/events","html_url":"https://github.com/wet-boew/wet-boew/issues/6796","id":81038005,"number":6796,"title":"Adding validation rules","user":{"login":"GarthMartin","id":11050106,"avatar_url":"https://avatars.githubusercontent.com/u/11050106?v=3","gravatar_id":"","url":"https://api.github.com/users/GarthMartin","html_url":"https://github.com/GarthMartin","followers_url":"https://api.github.com/users/GarthMartin/followers","following_url":"https://api.github.com/users/GarthMartin/following{/other_user}","gists_url":"https://api.github.com/users/GarthMartin/gists{/gist_id}","starred_url":"https://api.github.com/users/GarthMartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GarthMartin/subscriptions","organizations_url":"https://api.github.com/users/GarthMartin/orgs","repos_url":"https://api.github.com/users/GarthMartin/repos","events_url":"https://api.github.com/users/GarthMartin/events{/privacy}","received_events_url":"https://api.github.com/users/GarthMartin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wet-boew/wet-boew/labels/Plugin:%20Form%20Validation%20(jQuery%20Validation)","name":"Plugin: Form Validation (jQuery Validation)","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-26T16:28:28Z","updated_at":"2015-05-26T18:42:53Z","closed_at":"2015-05-26T18:42:53Z","body":"I am trying to add some validation rules and getting inconsistent behaviour between two pages.  The pages in questions are virtual copies of each other, in that they perform nearly identical functionality with different data entities (CRUD), but the manner in which the pages work is identical (load, display, add/edit/delete).\r\n\r\nIn a page specific javascript file I have the following:\r\n```javascript\r\n// add some custom validation\r\n$(document).on(\"wb-ready.wb-frmvld\", \".wb-frmvld\", function (event) {\r\n    $(\"#PostalCodeValue\").rules(\"add\", { postalCodeCA: true });\r\n});\r\n```\r\nand this works just fine.\r\n\r\nHOWEVER, in the page that gathers phone numbers, I have the following, in exactly the same place in the page processing sequence:\r\n```javascript\r\n// add some custom validation rules\r\n$(document).on(\"wb-ready.wb-frmvld\", \".wb-frmvld\", function (event) {\r\n     $(\"#PhoneNumberValue\").rules(\"add\", { phoneUS: true });\r\n});\r\n```\r\nand jquery.validator.min.js throws an error \r\n``` \r\nUnable to get value of the property 'form': object is null or undefined\r\n```\r\n\r\nIf I move the validation rules into a section that is \r\n```javascript\r\n$(document).on(\"wb-ready.wb\", function () {});\r\n```\r\nI do not get an error for Phone Number, but the rule is not added.\r\n\r\nAny thoughts?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/wet-boew/wet-boew/issues/comments/105630675","html_url":"https://github.com/wet-boew/wet-boew/issues/6796#issuecomment-105630675","issue_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6796","id":105630675,"user":{"login":"GarthMartin","id":11050106,"avatar_url":"https://avatars.githubusercontent.com/u/11050106?v=3","gravatar_id":"","url":"https://api.github.com/users/GarthMartin","html_url":"https://github.com/GarthMartin","followers_url":"https://api.github.com/users/GarthMartin/followers","following_url":"https://api.github.com/users/GarthMartin/following{/other_user}","gists_url":"https://api.github.com/users/GarthMartin/gists{/gist_id}","starred_url":"https://api.github.com/users/GarthMartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GarthMartin/subscriptions","organizations_url":"https://api.github.com/users/GarthMartin/orgs","repos_url":"https://api.github.com/users/GarthMartin/repos","events_url":"https://api.github.com/users/GarthMartin/events{/privacy}","received_events_url":"https://api.github.com/users/GarthMartin/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T18:42:53Z","updated_at":"2015-05-26T18:42:53Z","body":"Thanks!"}}