{"action":"created","issue":{"url":"https://api.github.com/repos/mcintyre321/FormFactory/issues/65","repository_url":"https://api.github.com/repos/mcintyre321/FormFactory","labels_url":"https://api.github.com/repos/mcintyre321/FormFactory/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/mcintyre321/FormFactory/issues/65/comments","events_url":"https://api.github.com/repos/mcintyre321/FormFactory/issues/65/events","html_url":"https://github.com/mcintyre321/FormFactory/issues/65","id":337806462,"node_id":"MDU6SXNzdWUzMzc4MDY0NjI=","number":65,"title":"Required attribute","user":{"login":"adaml984","id":25032444,"node_id":"MDQ6VXNlcjI1MDMyNDQ0","avatar_url":"https://avatars0.githubusercontent.com/u/25032444?v=4","gravatar_id":"","url":"https://api.github.com/users/adaml984","html_url":"https://github.com/adaml984","followers_url":"https://api.github.com/users/adaml984/followers","following_url":"https://api.github.com/users/adaml984/following{/other_user}","gists_url":"https://api.github.com/users/adaml984/gists{/gist_id}","starred_url":"https://api.github.com/users/adaml984/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adaml984/subscriptions","organizations_url":"https://api.github.com/users/adaml984/orgs","repos_url":"https://api.github.com/users/adaml984/repos","events_url":"https://api.github.com/users/adaml984/events{/privacy}","received_events_url":"https://api.github.com/users/adaml984/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-03T09:02:17Z","updated_at":"2018-07-03T09:28:35Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\nForm the beginning, here's part of my viewmodel, two sample properties:\r\n[Required]\r\npublic string CompanyName { get; set; }\r\n\r\n[Required]\r\n[Radio]\r\npublic ContractType ContractType { get; set; }\r\n\r\nHere's how I build form:\r\n<form action=\"/employeedocumentsgenerator/index\" method=\"post\">\r\n    @{\r\n    var props = FF.PropertiesFor(Model);\r\n    @props.Render(Html);\r\n}\r\n<input type=\"submit\" value=\"wyślij\"/>\r\n</form>\r\n\r\nWhen I post form and CompanyName is empty/null I don't get validation message that says CompanyName is required. \r\nOn the other hand when ContractType enum value is not set I get message that says ContractType is required.\r\nIt seems that Required on string properties does not work or I'm missusing it.\r\nCould you clarify how to use that attribute?\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mcintyre321/FormFactory/issues/comments/402075864","html_url":"https://github.com/mcintyre321/FormFactory/issues/65#issuecomment-402075864","issue_url":"https://api.github.com/repos/mcintyre321/FormFactory/issues/65","id":402075864,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjA3NTg2NA==","user":{"login":"mcintyre321","id":275706,"node_id":"MDQ6VXNlcjI3NTcwNg==","avatar_url":"https://avatars1.githubusercontent.com/u/275706?v=4","gravatar_id":"","url":"https://api.github.com/users/mcintyre321","html_url":"https://github.com/mcintyre321","followers_url":"https://api.github.com/users/mcintyre321/followers","following_url":"https://api.github.com/users/mcintyre321/following{/other_user}","gists_url":"https://api.github.com/users/mcintyre321/gists{/gist_id}","starred_url":"https://api.github.com/users/mcintyre321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcintyre321/subscriptions","organizations_url":"https://api.github.com/users/mcintyre321/orgs","repos_url":"https://api.github.com/users/mcintyre321/repos","events_url":"https://api.github.com/users/mcintyre321/events{/privacy}","received_events_url":"https://api.github.com/users/mcintyre321/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T09:28:35Z","updated_at":"2018-07-03T09:28:35Z","author_association":"OWNER","body":"Can you try using the [StringLength] attribute to ensure there are some characters?\r\n\r\nIt's been a while since I've worked on this, but I vaguely remember that strings are a bit funny, due to whitespace being a valid value.\r\n\r\nThere's maybe some work to needed on https://github.com/mcintyre321/FormFactory/blob/master/FormFactory/UnobtrusiveValidation/ClientValidationRules.cs "}}
{"actor":{"display_login":"mcintyre321"}}