Meteor react onSubmit does not work when multiple input


I have a form, if i just let ‘post’ input exist, i can submit the form but when i add another input like ‘owner’, onSubmit method is not working. When i click enter, nothing is happened. Thanks for answers.

class PostForm extends Component {
addPost(event) {
     var yell =;
     var owner = this.refs.owner.value.trim();
   'addPost', post,owner error => { 
        if (error) { 
            console.log('error', error); 
         console.log('post added ' );  

render() {
    return (
            <form className="commentForm" onSubmit={this.addPost.bind(this)} > 
                        placeholder="yell something!"



So far as i know, this is browser behaviour if you have one input in a form, ‘enter’ will auto submit the form. More than one input, no. So you might need to consider using a <button> instead?

Or on keyup on each input then detect ‘enter’ key and submit the form.


Thank you, Kenken! I just spent over an hour pulling my hair out over this problem.