i_trope i_trope - 10 months ago 80
React JSX Question

React - on form submit get POST params

I am using React, and would like to retrieve POST params from a form (see below):

<form ref='form' className="form">
<input type="text" className="signup-input" />
<input type="text" className="signup-input" />
<button className="btn btn-primary" onClick={this._onSubmitClick}>Submit</button>

In the
callback, I would like to achieve the same results as calling
but without using JQuery.

Joe Joe
Answer Source
var elements = this.refs.form.getDOMNode().elements;

gives you an object containing each of the input nodes, which you could then iterate through.