The form onSubmit method(_updateThing) is not fired in my react.js app.
The source code is like the following.
I think the problem is easy, but I spend lots of time to check it , can't solve it.Please help me.
what is wrong with my code:
export default React.createClass({ displayName: 'ThingContainer', statics: { load: function (context) { return ThingActions.getData(context); } }, mixins: [ContextMixin, MaterialRebindMixin], getInitialState() { return getThings(); }, _updateThing(e) { alert(1); e.preventDefault(); }, _setChangedText(event) { alert('change'); }, render() { return ( <div> <div> <div> <h2>Title</h2> </div> <form onSubmit={this._updateThing}> <div > <Label htmlFor="changeQuantity" text="" /> <Input id="changeQuantity" name="changeQuantity" type="text" onChange={this._setChangedText} /> </div> <div className="form-footer"> <div style={{float: 'right'}}> <input type="submit" value="submit" /> </div> </div> </form> </div> </div> ); } });
I changed "form onSubmit={this._updateThing}" into "form onSubmit={this._updateThing.bind(this)}", but nothing changed.
I also using Chrome dev console to check html source,onSubmit method(_updateThing) is not shown in the html source.
Capture
Thanks in advances.