{"action":"created","issue":{"url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/666","labels_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/666/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/666/comments","events_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/666/events","html_url":"https://github.com/aldeed/meteor-autoform/issues/666","id":55923620,"number":666,"title":"Custom template for afArrayField does not seem to clear validation message","user":{"login":"ksmaingi","id":243764,"avatar_url":"https://avatars.githubusercontent.com/u/243764?v=3","gravatar_id":"","url":"https://api.github.com/users/ksmaingi","html_url":"https://github.com/ksmaingi","followers_url":"https://api.github.com/users/ksmaingi/followers","following_url":"https://api.github.com/users/ksmaingi/following{/other_user}","gists_url":"https://api.github.com/users/ksmaingi/gists{/gist_id}","starred_url":"https://api.github.com/users/ksmaingi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksmaingi/subscriptions","organizations_url":"https://api.github.com/users/ksmaingi/orgs","repos_url":"https://api.github.com/users/ksmaingi/repos","events_url":"https://api.github.com/users/ksmaingi/events{/privacy}","received_events_url":"https://api.github.com/users/ksmaingi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aldeed/meteor-autoform/labels/needs%20reproduction","name":"needs reproduction","color":"eb6420"},{"url":"https://api.github.com/repos/aldeed/meteor-autoform/labels/potential%20bug","name":"potential bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-29T16:41:38Z","updated_at":"2015-01-30T00:19:31Z","closed_at":null,"body":"I created a custom template for afArrayField to capture phone numbers, the schema is as follows:\r\n\r\n```\r\n    phoneNumber: {\r\n        label: \"Phone Number(s)\",\r\n        type: Array,\r\n        minCount: 1\r\n    },\r\n    'phoneNumber.$': {\r\n        type: Object\r\n    },\r\n    'phoneNumber.$.phone': {\r\n        type: String,\r\n        regEx: /^\\s*\\(?(020[7,8]{1}\\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}[0-9]{3}\\)?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{3})\\s*$/\r\n    },\r\n    'phoneNumber.$.type': {\r\n        type: String,\r\n        allowedValues: ['Mobile', 'Home', 'Work', 'Other']\r\n    },\r\n```\r\n\r\nThis is my template:\r\n```\r\n<template name=\"afArrayField_phoneNumbers\">\r\n<div class=\"form-group{{#if afFieldIsInvalid name=this.atts.name}} has-error{{/if}}\">\r\n    <label class=\"col-sm-3 control-label qformlabel\" {{afFieldLabelAtts}}>{{afFieldLabelText name=this.atts.name}}</label>\r\n    <div class=\"col-sm-9\">\r\n        {{#if afFieldIsInvalid name=this.atts.name}}\r\n        <div class=\"panel-body has-error\">\r\n            <span class=\"help-block\">{{{afFieldMessage name=this.atts.name}}}</span>\r\n        </div>\r\n        {{/if}}\r\n        <ul class=\"list-group\">\r\n            {{#afEachArrayItem name=this.atts.name minCount=this.atts.minCount maxCount=this.atts.maxCount}}\r\n            <li class=\"list-group-item autoform-array-item\">\r\n                <div class=\"row\">\r\n                    <div class=\"col-xs-12\">\r\n                        {{> afObjectField name=this.name template=\"customObjectField\"}}\r\n                        <div class=\"col-xs-2\" id=\"phoneNumbersButton\">\r\n                        <div class=\"form-group\">\r\n                            <label class=\"col-xs-3 control-label\">&nbsp;</label>\r\n                            {{#if afArrayFieldHasMoreThanMinimum name=../atts.name minCount=../atts.minCount maxCount=../atts.maxCount}}\r\n                            <button type=\"button\" class=\"btn btn-primary autoform-remove-item\">Delete</button>\r\n                            {{/if}}\r\n                        </div>\r\n                    </div>\r\n                    </div>\r\n                </div>\r\n            </li>\r\n            {{/afEachArrayItem}}\r\n            {{#if afArrayFieldHasLessThanMaximum name=this.atts.name minCount=this.atts.minCount maxCount=this.atts.maxCount}}\r\n            <li class=\"list-group-item\">\r\n                <button type=\"button\" class=\"btn btn-primary autoform-add-item\" data-autoform-field=\"{{this.atts.name}}\" data-autoform-minCount=\"{{this.atts.minCount}}\" data-autoform-maxCount=\"{{this.atts.maxCount}}\">Add Another Number</button>\r\n            </li>\r\n            {{/if}}\r\n        </ul>\r\n    </div>\r\n</div>\r\n</template>\r\n```\r\n\r\ncustomObjectField template:\r\n```\r\n<template name=\"afObjectField_customObjectField\">\r\n      {{#if afFieldIsInvalid name=this.atts.name}}\r\n      <span class=\"help-block\">{{{afFieldMessage name=this.atts.name}}}</span>\r\n      {{/if}}\r\n      {{#each afFieldNames name=this.atts.name}}\r\n        <div class=\"col-xs-5\">\r\n            {{> afQuickField name=this options=\"auto\" label-class=\"col-sm-3 qformlabel\" class=\"phoneNumber\" }}\r\n        </div>\r\n      {{/each}}\r\n\r\n</template>\r\n```\r\nWhat I'm finding is that if there is a validation message, even if I fill in the phone number and type, it still won't remove the validation message. Although it will submit, which is great, I also need to let the user know that they have no errors.\r\n\r\nAm I doing something wrong? I did try changing the validation type in the autoform to `blur` and then `keyup`, but that hasn't helped."},"comment":{"url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/comments/72131648","html_url":"https://github.com/aldeed/meteor-autoform/issues/666#issuecomment-72131648","issue_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/666","id":72131648,"user":{"login":"ksmaingi","id":243764,"avatar_url":"https://avatars.githubusercontent.com/u/243764?v=3","gravatar_id":"","url":"https://api.github.com/users/ksmaingi","html_url":"https://github.com/ksmaingi","followers_url":"https://api.github.com/users/ksmaingi/followers","following_url":"https://api.github.com/users/ksmaingi/following{/other_user}","gists_url":"https://api.github.com/users/ksmaingi/gists{/gist_id}","starred_url":"https://api.github.com/users/ksmaingi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksmaingi/subscriptions","organizations_url":"https://api.github.com/users/ksmaingi/orgs","repos_url":"https://api.github.com/users/ksmaingi/repos","events_url":"https://api.github.com/users/ksmaingi/events{/privacy}","received_events_url":"https://api.github.com/users/ksmaingi/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T00:19:31Z","updated_at":"2015-01-30T00:19:31Z","body":"The input type is `type=\"hidden\"`\r\n\r\nThis is the link to MeteorPad: http://meteorpad.com/pad/c4krN3SPHJTtbvxYP/ClientTest"}}