{"action":"created","issue":{"url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/235","repository_url":"https://api.github.com/repos/slamdata/purescript-halogen","labels_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/235/comments","events_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/235/events","html_url":"https://github.com/slamdata/purescript-halogen/issues/235","id":114966170,"number":235,"title":"form validation in halogen","user":{"login":"cdepillabout","id":64804,"avatar_url":"https://avatars.githubusercontent.com/u/64804?v=3","gravatar_id":"","url":"https://api.github.com/users/cdepillabout","html_url":"https://github.com/cdepillabout","followers_url":"https://api.github.com/users/cdepillabout/followers","following_url":"https://api.github.com/users/cdepillabout/following{/other_user}","gists_url":"https://api.github.com/users/cdepillabout/gists{/gist_id}","starred_url":"https://api.github.com/users/cdepillabout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdepillabout/subscriptions","organizations_url":"https://api.github.com/users/cdepillabout/orgs","repos_url":"https://api.github.com/users/cdepillabout/repos","events_url":"https://api.github.com/users/cdepillabout/events{/privacy}","received_events_url":"https://api.github.com/users/cdepillabout/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-04T04:18:57Z","updated_at":"2016-03-11T17:24:00Z","closed_at":"2016-03-11T17:24:00Z","body":"Is there a library providing easy form validation in Halogen?\r\n\r\nFor example, on my site I have a registration form, and I want the following three things:\r\n\r\n1. When the user clicks the \"submit\" button, the form is only submitted if it is valid.\r\n2. When an input box is invalid, an error should be shown to the user. For example, if the user is inputting an email address and it doesn't have a `@` in it, there should be a message that says \"email address invalid\".  Ideally, I should be able to choose whether the error is next to the input box in question, or at the top of the form.\r\n3. The ability to attach arbitrary \"validation functions\" to an input box.  Maybe these could be modeled as prisms (or traversals)?\r\n\r\nI guess it would be nice if errors reported from the server could also be handled using the same framework.  For example, if the user tries to use an email address that already exists, the error could be shown to the user in the exact same way that the \"email address invalid\" is shown in (2) above.\r\n\r\n@parsonsmatt has done some work on form validation:\r\nhttps://github.com/parsonsmatt/ql-purs/blob/master/src/Form/WForm.purs\r\nhttps://github.com/parsonsmatt/ql-purs/blob/master/src/Form.purs\r\n\r\nWould it be worth it to wrap this up into a library?"},"comment":{"url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/comments/195464534","html_url":"https://github.com/slamdata/purescript-halogen/issues/235#issuecomment-195464534","issue_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/235","id":195464534,"user":{"login":"cdepillabout","id":64804,"avatar_url":"https://avatars.githubusercontent.com/u/64804?v=3","gravatar_id":"","url":"https://api.github.com/users/cdepillabout","html_url":"https://github.com/cdepillabout","followers_url":"https://api.github.com/users/cdepillabout/followers","following_url":"https://api.github.com/users/cdepillabout/following{/other_user}","gists_url":"https://api.github.com/users/cdepillabout/gists{/gist_id}","starred_url":"https://api.github.com/users/cdepillabout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdepillabout/subscriptions","organizations_url":"https://api.github.com/users/cdepillabout/orgs","repos_url":"https://api.github.com/users/cdepillabout/repos","events_url":"https://api.github.com/users/cdepillabout/events{/privacy}","received_events_url":"https://api.github.com/users/cdepillabout/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T17:24:00Z","updated_at":"2016-03-11T17:24:00Z","body":"Yeah, thanks :-)"}}