{"action":"created","issue":{"url":"https://api.github.com/repos/jquense/react-formal/issues/3","labels_url":"https://api.github.com/repos/jquense/react-formal/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/jquense/react-formal/issues/3/comments","events_url":"https://api.github.com/repos/jquense/react-formal/issues/3/events","html_url":"https://github.com/jquense/react-formal/issues/3","id":77444838,"number":3,"title":"How to set invalid date message, use onsubmit and re-render form","user":{"login":"deezahyn","id":532797,"avatar_url":"https://avatars.githubusercontent.com/u/532797?v=3","gravatar_id":"","url":"https://api.github.com/users/deezahyn","html_url":"https://github.com/deezahyn","followers_url":"https://api.github.com/users/deezahyn/followers","following_url":"https://api.github.com/users/deezahyn/following{/other_user}","gists_url":"https://api.github.com/users/deezahyn/gists{/gist_id}","starred_url":"https://api.github.com/users/deezahyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deezahyn/subscriptions","organizations_url":"https://api.github.com/users/deezahyn/orgs","repos_url":"https://api.github.com/users/deezahyn/repos","events_url":"https://api.github.com/users/deezahyn/events{/privacy}","received_events_url":"https://api.github.com/users/deezahyn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-05-18T00:56:02Z","updated_at":"2015-05-18T03:48:21Z","closed_at":null,"body":"1. How do I set the invalid date message for `type=date` . Right now if I choose a date, and remove it, I get: ``this (value: ` `) must be a `date` type``\r\n\r\n2. If I only want to update my models onSubmit?\r\n  `<Form\r\n            schema={modelSchema}\r\n            defaultValue={modelSchema.default() }\r\n            onSubmit={ model => this.setState({ model })}\r\n          >`\r\n\r\n  If I do this:\r\n  `\r\n   componentDidUpdate(prevProps, prevState) {\r\n    console.log(this.state.model)\r\n  }\r\n `\r\nI only get a SyntheticEvent Object; This works correctly if I use onChange however.\r\n\r\n3. How do I force re-render the whole form on schema change? Say if I want to customize the messages.\r\n\r\n4. Is there an example how to use errors object?"},"comment":{"url":"https://api.github.com/repos/jquense/react-formal/issues/comments/102914830","html_url":"https://github.com/jquense/react-formal/issues/3#issuecomment-102914830","issue_url":"https://api.github.com/repos/jquense/react-formal/issues/3","id":102914830,"user":{"login":"deezahyn","id":532797,"avatar_url":"https://avatars.githubusercontent.com/u/532797?v=3","gravatar_id":"","url":"https://api.github.com/users/deezahyn","html_url":"https://github.com/deezahyn","followers_url":"https://api.github.com/users/deezahyn/followers","following_url":"https://api.github.com/users/deezahyn/following{/other_user}","gists_url":"https://api.github.com/users/deezahyn/gists{/gist_id}","starred_url":"https://api.github.com/users/deezahyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deezahyn/subscriptions","organizations_url":"https://api.github.com/users/deezahyn/orgs","repos_url":"https://api.github.com/users/deezahyn/repos","events_url":"https://api.github.com/users/deezahyn/events{/privacy}","received_events_url":"https://api.github.com/users/deezahyn/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T03:48:21Z","updated_at":"2015-05-18T03:48:21Z","body":"that works!!\r\n\r\n```\r\n<Form.Field type={ DropdownList }\r\n              valueField='id'\r\n              textField='name'\r\n              mapValue={ value => value.id }\r\n              defaultValue={ 0 }\r\n              data={ colors }\r\n              name='colorId'\r\n            />\r\n```\r\n\r\n>defaultValue won't work in this case because the field is manually setting value/onChange on the inputs, To set an initial value for a field initialize the form value:\r\n\r\nFinal code, its worth mentioning that the defaultValue works in this instance.\r\n\r\n---\r\n\r\nLastly I can see that the errors indeed is working using the code below. however It doesn't have a map what kind of error.  say if its a type error, required error or a max error.\r\n\r\n```\r\n\r\nsetErrors(errors) {\r\n  if ( errors['dateOfBirth'] ) //if dob is in the error state change the message\r\n    errors['dateOfBirth'] = \"swap out the message for this one!\"\r\n\r\n  this.setState({ errors })\r\n}\r\n```\r\n\r\nSo the errors are just flat array without key values of what type of error it is?\r\n"}}