Skip to content

this.refs.title.getDOMNode is not a function #601

@MrAbalogu

Description

@MrAbalogu

` handleSubmit() {

    var title = this.refs.title.getDOMNode().value.trim();
    var description = this.refs.description.getDOMNode.value.trim();
    this.props.onCommentSubmit({title: title, description: description});
    this.refs.title.getDOMNode().value = '';
    this.refs.description.getDOMNode().value = '';
    return false;
},`

I have a form
<form className="requestForm" onSubmit={this.handleSubmit}> <input className="form-control" type="text" placeholder="Your title" ref="title" /> <input className="form-control" type="text" placeholder="Say something..." ref="description" /> <input className="form-control" type="submit" value="Post" /> </form>

but i keep getting an error that this.refs.title.getDOMNode is not a function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions