From 65874732b0e6743e4c2af6beba183ed76c31fb93 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/tutorial.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/tutorial.md b/docs/tutorial.md index 6b771aeba..882d2ad41 100644 --- a/docs/tutorial.md +++ b/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 = '';