{"action":"opened","issue":{"url":"https://api.github.com/repos/xoxco/jQuery-Tags-Input/issues/303","labels_url":"https://api.github.com/repos/xoxco/jQuery-Tags-Input/issues/303/labels{/name}","comments_url":"https://api.github.com/repos/xoxco/jQuery-Tags-Input/issues/303/comments","events_url":"https://api.github.com/repos/xoxco/jQuery-Tags-Input/issues/303/events","html_url":"https://github.com/xoxco/jQuery-Tags-Input/issues/303","id":126367402,"number":303,"title":"Semantic UI and Form Validations","user":{"login":"krtschmr","id":13366714,"avatar_url":"https://avatars.githubusercontent.com/u/13366714?v=3","gravatar_id":"","url":"https://api.github.com/users/krtschmr","html_url":"https://github.com/krtschmr","followers_url":"https://api.github.com/users/krtschmr/followers","following_url":"https://api.github.com/users/krtschmr/following{/other_user}","gists_url":"https://api.github.com/users/krtschmr/gists{/gist_id}","starred_url":"https://api.github.com/users/krtschmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krtschmr/subscriptions","organizations_url":"https://api.github.com/users/krtschmr/orgs","repos_url":"https://api.github.com/users/krtschmr/repos","events_url":"https://api.github.com/users/krtschmr/events{/privacy}","received_events_url":"https://api.github.com/users/krtschmr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-13T08:27:00Z","updated_at":"2016-01-13T08:27:00Z","closed_at":null,"body":"Using SemanticUI with form validations causing the following propblem:\r\n\r\nAs soon we press the Enter Button the Form.Validation will use the KeyDown Event to trigger validations. If they pass, the form will be submitted - before the Tag was added.\r\n\r\nThe following Snippet is helping.\r\n\r\nWe need to catch the Enter of that fake_input and stop the propagation, that means, nothing will be triggered anymore, neither the FormValidation of SUI nor the AddTag function. So then we need to call the addTag manually.\r\n\r\n\r\n````\r\n   $(data.fake_input).keydown(function(event){\r\n          if(event.keyCode == 13) {\r\n            event.stopPropagation();\r\n\r\n            if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length) ) ){\r\n              $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});\r\n              $(event.data.fake_input).resetAutosize(settings);\r\n              return false;\r\n            }\r\n          }\r\n        });\r\n````"}}