I'm trying to exclude minus and plus from input, but it's going wrong:
handleChange(event) {
const value = event.target.value.replace(/+|-/ig, '');
this.setState({financialGoal: value});
}
Render input code:
<input style={{width: '150px'}} type="number" value={this.state.financialGoal} onChange={this.handleChange}/>
See Question&Answers more detail:os