用户在 FormControl 中输入文本字符串,我想将其重新修剪并小写。
handleSubmit(event) {
event.preventDefault();
console.log("submitted: "+ this.vehicleReg.value.trim().toLowerCase());
this.refs.vehicleReg.value=this.vehicleReg.value.trim().toLowerCase();
}
render() {
return(
<form className="user-data" onSubmit={this.handleSubmit.bind(this)}>
<FormGroup label="Data">
<FormControl
inputRef={(input) => this.vehicleReg = input} type="text"
placeholder="Reg Number"