I have made form which has 1 question. There are 4 radio button options and 1 input box for other radio button. How can I get value from the input box if the other radio button is checked.
class ContactForm extends Component {
setGender(event){
console.log(event.target.value);
}
render(){
<form>
<div id="gender" onChange={this.setGender.bind(this)}>
<div className="form-group">
<div className="col-sm-offset-2 col-sm-10">
<h4>What is your gender?</h4>
</div>
</div>
<div className="form-group">
<div className="col-sm-offset-2 col-sm-10">
<div className="radio">
<label><input type="radio" name="gender"/> Female</label>
</div>
</div>
</div>
<div className="form-group">
<div className="col-sm-offset-2 col-sm-10">
<div className="radio">
<label><input type="radio" name="gender"/> Male</label>
</div>
</div>
</div>
<div className="form-group">
<div className="col-sm-offset-2 col-sm-10">
<div className="radio">
<label><input type="radio" name="gender"/> Prefer not to say</label>
</div>
</div>
</div>
<div className="form-group">
<div className="col-sm-offset-2 col-sm-10">
<div className="radio">
<label><input type="radio" name="gender"/>Other</label>
<input type="text" class="form-inline" id="other1"/>
</div>
</div>
</div>
</div>
</form>
}
