{"action":"created","issue":{"url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7067","labels_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7067/labels{/name}","comments_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7067/comments","events_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7067/events","html_url":"https://github.com/wet-boew/wet-boew/issues/7067","id":103723654,"number":7067,"title":"Duplicate validation errors if using \"require_from_group\"","user":{"login":"rachelywang","id":12052626,"avatar_url":"https://avatars.githubusercontent.com/u/12052626?v=3","gravatar_id":"","url":"https://api.github.com/users/rachelywang","html_url":"https://github.com/rachelywang","followers_url":"https://api.github.com/users/rachelywang/followers","following_url":"https://api.github.com/users/rachelywang/following{/other_user}","gists_url":"https://api.github.com/users/rachelywang/gists{/gist_id}","starred_url":"https://api.github.com/users/rachelywang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachelywang/subscriptions","organizations_url":"https://api.github.com/users/rachelywang/orgs","repos_url":"https://api.github.com/users/rachelywang/repos","events_url":"https://api.github.com/users/rachelywang/events{/privacy}","received_events_url":"https://api.github.com/users/rachelywang/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":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-28T14:00:21Z","updated_at":"2015-09-03T19:23:40Z","closed_at":null,"body":"I added a customized validation to ensure at least one field (telephone number, email) must be filled, using jQuery \"require_from_group\". Now the errors are displayed multiple times at the top of the page.\r\n\r\n![snap5](https://cloud.githubusercontent.com/assets/12052626/9547845/15c9ed7a-4d6b-11e5-81b0-d17cc3b3ca78.jpg)\r\n\r\nMy code:\r\n\r\n<div class=\"row\">\r\n            <div class=\"col-md-6 pull-left\">\r\n                <div class=\"form-group\"><label for=\"submitter_telephoneNumber\" class=\"required\"><span class=\"field-name\">Telephone (including area code): </span><br> <strong class=\"required\">(Telephone OR Email is required)</strong> , both is preferred</label>\r\n                     <input class=\"form-control required_group\" type=\"tel\" id=\"submitter_telephoneNumber\" name=\"submitter_telephoneNumber\" ng-model=\"submitter.telephoneNumber\" placeholder=\"Telephone\" maxlength=\"50\"/>\r\n                </div>\r\n            </div>\r\n            <div class=\"col-md-6 pull-right\">\r\n                <div class=\"form-group\"><label for=\"submitter_email\" class=\"required\"><span class=\"field-name\">Email: </span><br> <strong class=\"required\">(Email OR Telephone is required)</strong> , both is preferred</label>\r\n                     <input class=\"form-control required_group\" type=\"email\" id=\"submitter_email\" name=\"submitter_email\" ng-model=\"submitter.email\" placeholder=\"email@example.com\" maxlength=\"50\"/>\r\n                </div>\r\n            </div>\r\n        </div>\r\n...\r\n<script src=\"./wet-boew/js/wet-boew.min.js\"></script>\r\n<script>\r\nwb.doc.on( \"wb-ready.wb-frmvld\", \".wb-frmvld\", function( event ) {\r\n    $(\".required_group\").each(function () {\t\r\n        $(this).rules('add', {\r\n            require_from_group: [1, \".required_group\"],\r\n            messages: {\r\n                require_from_group: 'An email or telephone is required.'\r\n            }        \t\r\n        });\r\n    });\r\n});\r\n\r\nI'm using Firefox 40.0.3 and latest WET4 version 17.\r\n\r\nI tried previous versions, and this issue appeared since version 12 when the fix of summary links was introduced.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/wet-boew/wet-boew/issues/comments/137547753","html_url":"https://github.com/wet-boew/wet-boew/issues/7067#issuecomment-137547753","issue_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/7067","id":137547753,"user":{"login":"rachelywang","id":12052626,"avatar_url":"https://avatars.githubusercontent.com/u/12052626?v=3","gravatar_id":"","url":"https://api.github.com/users/rachelywang","html_url":"https://github.com/rachelywang","followers_url":"https://api.github.com/users/rachelywang/followers","following_url":"https://api.github.com/users/rachelywang/following{/other_user}","gists_url":"https://api.github.com/users/rachelywang/gists{/gist_id}","starred_url":"https://api.github.com/users/rachelywang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachelywang/subscriptions","organizations_url":"https://api.github.com/users/rachelywang/orgs","repos_url":"https://api.github.com/users/rachelywang/repos","events_url":"https://api.github.com/users/rachelywang/events{/privacy}","received_events_url":"https://api.github.com/users/rachelywang/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T19:23:40Z","updated_at":"2015-09-03T19:23:40Z","body":"I moved the declaration of \"$summaryContainer\" from the beginning of the showErrors function to the place inside of the setTimeout function, now it works. Here is the code:\r\n\r\nsetTimeout( function() {\r\nvar $summaryContainer = $form.find( \"#\" + errorFormId );\r\n// Output our error summary and place it in the error container\r\n// Create our container if one doesn't already exist\r\nif ( $summaryContainer.length === 0 ) {\r\n$summaryContainer = $( \"<section id='\" + errorFormId + \"' class='alert alert-danger' tabindex='-1'>\" + summary + \"</section>\" ).prependTo( $form );\r\n} else {\r\n$summaryContainer.empty().append( summary );\r\n}\r\n..."}}