{"action":"opened","issue":{"url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7653","repository_url":"https://api.github.com/repos/wet-boew/wet-boew","labels_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7653/labels{/name}","comments_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7653/comments","events_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7653/events","html_url":"https://github.com/wet-boew/wet-boew/issues/7653","id":174310880,"number":7653,"title":"Form Validation: Custom Validation Method not adding","user":{"login":"ZaphodBebbleBrox","id":7805875,"avatar_url":"https://avatars.githubusercontent.com/u/7805875?v=3","gravatar_id":"","url":"https://api.github.com/users/ZaphodBebbleBrox","html_url":"https://github.com/ZaphodBebbleBrox","followers_url":"https://api.github.com/users/ZaphodBebbleBrox/followers","following_url":"https://api.github.com/users/ZaphodBebbleBrox/following{/other_user}","gists_url":"https://api.github.com/users/ZaphodBebbleBrox/gists{/gist_id}","starred_url":"https://api.github.com/users/ZaphodBebbleBrox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZaphodBebbleBrox/subscriptions","organizations_url":"https://api.github.com/users/ZaphodBebbleBrox/orgs","repos_url":"https://api.github.com/users/ZaphodBebbleBrox/repos","events_url":"https://api.github.com/users/ZaphodBebbleBrox/events{/privacy}","received_events_url":"https://api.github.com/users/ZaphodBebbleBrox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-31T15:54:39Z","updated_at":"2016-08-31T15:54:39Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to add a custom validation method for a date picker on a form. The date can only be a date in the future. \r\n\r\nIn the aspx file I have:\r\n\r\n$(document).on(\"wb-ready.wb-frmvld\", \".wb-frmvld\", function ( event ) {\r\n$.validator.addMethod(\"futureDate\", function (value, element) {\r\nvar currentDate = new Date();\r\nvar selectedDate = new Date();\r\nreturn this.option(element) || selectedDate > currentDate;\r\n}, \"Date must be after today's date\");\r\n});\r\n\r\nThen an onclick function for calling the validate method:\r\nfunction validateFunction(){\r\n$('#form').validate({\r\nrules: {\r\n           datepicker: {futureDate: true}\r\n});}\r\n\r\nIt seems something is going wrong with the validator.addMethod portion. It doesn't seem to run. I found a previous post about waiting for the form, but adding that didn't seem to help. The regular WET form validation still works as expected. Any ideas?\r\n\r\nThanks"}}
{"actor":{"display_login":"ZaphodBebbleBrox"}}