frontend user input handling

This commit is contained in:
GotPPay
2018-01-29 21:32:24 +01:00
parent 3b5c287ef9
commit 5e92314938
5 changed files with 87 additions and 24 deletions

View File

@@ -52,12 +52,12 @@ class LaunchRequest extends Component {
}
handleNameEdit(e){
if (e.length === INVOCATION_NAME_MAX_LENGTH) return;
if (e.length === INVOCATION_NAME_MAX_LENGTH || !(/^[a-z,.' ]*$/i.test(e))) return;
this.setState({invocationName: e});
}
handleAnswerEdit(e){
if (e.length === INVOCATION_ANSWER_MAX_LENGTH) return;
if (e.length === INVOCATION_ANSWER_MAX_LENGTH || !(/^[a-z,.' ]*$/i.test(e))) return;
this.setState({invocationAnswer: e});
}
}