Skip to content

Commit

Permalink
added form submittal
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Apr 20, 2017
1 parent 131dc28 commit e8c09b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion blog/src/components/posts_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ class PostsNew extends Component {
);
}

onSubmit(values) {
// this === component
console.log(values);
}

render() {
const { handleSubmit } = this.props;

return (
<form>
<form onSubmit={handleSubmit(this.onSubmit.bind(this))}>
<Field
label="Title For Post"
name="title"
Expand All @@ -34,6 +41,7 @@ class PostsNew extends Component {
name="content"
component={this.renderField}
/>
<button type="submit" className="btn btn-primary">Submit</button>
</form>
);
}
Expand Down

0 comments on commit e8c09b6

Please sign in to comment.