From 6c926094c3c0ee5ea1b1b5d0811fe65e613003d9 Mon Sep 17 00:00:00 2001 From: Michael Randers-Pehrson Date: Thu, 21 Aug 2014 23:00:05 -0400 Subject: [PATCH] Including missing validation check The validation check was removed from the update to the CommentForm handleSubmit function. --- docs/docs/tutorial.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docs/tutorial.md b/docs/docs/tutorial.md index 6b771aebab..882d2ad412 100644 --- a/docs/docs/tutorial.md +++ b/docs/docs/tutorial.md @@ -565,6 +565,9 @@ var CommentForm = React.createClass({ handleSubmit: function() { var author = this.refs.author.getDOMNode().value.trim(); var text = this.refs.text.getDOMNode().value.trim(); + if (!text || !author) { + return false; + } this.props.onCommentSubmit({author: author, text: text}); this.refs.author.getDOMNode().value = ''; this.refs.text.getDOMNode().value = '';