Navigation Menu

Skip to content

Commit

Permalink
show final submitted value
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajsingh0101 committed Aug 22, 2015
1 parent d89d2b4 commit 46416b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ep03-handle-onchange/app/components/App.jsx
Expand Up @@ -10,6 +10,8 @@ export default class App extends React.Component {
handleSubmit (event) {
event.preventDefault();
console.log("form was submitted");
var text = this.state.text;
console.log("submitted form has value ", text);
}

handleChange (event) {
Expand All @@ -21,7 +23,7 @@ export default class App extends React.Component {
render () {
return <div>
<p> TODO </p>
<form onSubmit={this.handleSubmit}>
<form onSubmit={this.handleSubmit.bind(this)}>
<input onChange={this.handleChange.bind(this)} value={this.state.text} />
<button> Submit </button>
</form>
Expand Down

0 comments on commit 46416b4

Please sign in to comment.