{"action":"created","issue":{"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI/issues/752","labels_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI/issues/752/labels{/name}","comments_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI/issues/752/comments","events_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI/issues/752/events","html_url":"https://github.com/Semantic-Org/Semantic-UI/issues/752","id":30442619,"number":752,"title":"[Form Validation] Behavior to Set Field as Invalid ","user":{"login":"phillip-haydon","id":895629,"avatar_url":"https://avatars.githubusercontent.com/u/895629?v=3","gravatar_id":"","url":"https://api.github.com/users/phillip-haydon","html_url":"https://github.com/phillip-haydon","followers_url":"https://api.github.com/users/phillip-haydon/followers","following_url":"https://api.github.com/users/phillip-haydon/following{/other_user}","gists_url":"https://api.github.com/users/phillip-haydon/gists{/gist_id}","starred_url":"https://api.github.com/users/phillip-haydon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillip-haydon/subscriptions","organizations_url":"https://api.github.com/users/phillip-haydon/orgs","repos_url":"https://api.github.com/users/phillip-haydon/repos","events_url":"https://api.github.com/users/phillip-haydon/events{/privacy}","received_events_url":"https://api.github.com/users/phillip-haydon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI/labels/Enhancement","name":"Enhancement","color":"219a90"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-03-29T12:01:15Z","updated_at":"2015-06-15T07:52:12Z","closed_at":null,"body":"Possibly lacking docs on how to do this, but need the ability to mark a single field as invalid.\r\n\r\nI.e\r\n```javascript\r\n$('.ui.form').form('set fieldname', { valid: false, message: 'username is taken' });\r\n```\r\n\r\nThis is so validation outside of the form behaviour can be done. \r\n\r\n\r\nWoops... Just realised I raised this like 5 months ago already... #224 "},"comment":{"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI/issues/comments/111970217","html_url":"https://github.com/Semantic-Org/Semantic-UI/issues/752#issuecomment-111970217","issue_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI/issues/752","id":111970217,"user":{"login":"oniisaki","id":9282390,"avatar_url":"https://avatars.githubusercontent.com/u/9282390?v=3","gravatar_id":"","url":"https://api.github.com/users/oniisaki","html_url":"https://github.com/oniisaki","followers_url":"https://api.github.com/users/oniisaki/followers","following_url":"https://api.github.com/users/oniisaki/following{/other_user}","gists_url":"https://api.github.com/users/oniisaki/gists{/gist_id}","starred_url":"https://api.github.com/users/oniisaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oniisaki/subscriptions","organizations_url":"https://api.github.com/users/oniisaki/orgs","repos_url":"https://api.github.com/users/oniisaki/repos","events_url":"https://api.github.com/users/oniisaki/events{/privacy}","received_events_url":"https://api.github.com/users/oniisaki/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T07:52:12Z","updated_at":"2015-06-15T07:52:12Z","body":"Found a workaround that could be used until there is an official fix. Utilizes JQuery and semantic UI CSS classes.\r\n```javascript\r\n$(window).load(function (){\r\n\tvar form = $(\".ui.form\");\r\n\tvar fieldname = \"username\"\r\n\tform.addClass(\"error\");\r\n\tform.find(\":input[name='\"+fieldname+\"']\").closest( \".field\" ).addClass(\"error\");\r\n\tform.form(\"add errors\", [ 'Unexpected error with server-side validation' ]);\r\n});\r\n```"}}