Comparing version 0.0.10 to 0.0.11
@@ -44,3 +44,4 @@ import React from 'react' | ||
invalidForm={this.invalidForm.bind(this)} | ||
postUrl='http://localhost/post.php' | ||
postUrl='https://runkit.io/ozgrozer/recassfov-backend-demo/branches/master/signup' | ||
disableOnSubmit | ||
> | ||
@@ -47,0 +48,0 @@ <h2>Sign up</h2> |
{ | ||
"name": "recassfov", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "React Client and Server Side Form Validation", | ||
@@ -5,0 +5,0 @@ "main": "./npm/Recassfov.js", |
@@ -51,5 +51,3 @@ # recassfov | ||
```jsx | ||
<Form | ||
postUrl='http://example.com/post.php' | ||
> | ||
<Form postUrl='http://site.com/post'> | ||
<div> | ||
@@ -94,2 +92,18 @@ <Input | ||
Make sure you add the errors to the `validations` object in backend. | ||
```js | ||
app.post('/signup', (req, res) => { | ||
const result = { | ||
validations: {} | ||
} | ||
if (req.body.username === 'john') { | ||
result.validations.username = 'john is already registered' | ||
} | ||
res.send(result) | ||
}) | ||
``` | ||
## Callbacks | ||
@@ -96,0 +110,0 @@ |
161362
511
117