Browse Source

Including missing validation check

The validation check was removed from the update to the CommentForm handleSubmit function.
main
Michael Randers-Pehrson 10 years ago
parent
commit
65874732b0
  1. 3
      docs/tutorial.md

3
docs/tutorial.md

@ -565,6 +565,9 @@ var CommentForm = React.createClass({
handleSubmit: function() { handleSubmit: function() {
var author = this.refs.author.getDOMNode().value.trim(); var author = this.refs.author.getDOMNode().value.trim();
var text = this.refs.text.getDOMNode().value.trim(); var text = this.refs.text.getDOMNode().value.trim();
if (!text || !author) {
return false;
}
this.props.onCommentSubmit({author: author, text: text}); this.props.onCommentSubmit({author: author, text: text});
this.refs.author.getDOMNode().value = ''; this.refs.author.getDOMNode().value = '';
this.refs.text.getDOMNode().value = ''; this.refs.text.getDOMNode().value = '';

Loading…
Cancel
Save