I want user can enter his email id in English language only, User can't enter Japanese or chinese even if he has an option in his keyboard. I searched but I found some post which restrict user to enter special characters.
only allow English characters and numbers for text input
I have written this code.
_handleChange = (name, value) => {
value = value.replace(/[^A-Za-z]/ig, '');
const { data } = this.state;
data[name] = value;
this.setState(
{
data: JSON.parse(JSON.stringify(data))
},
() => {
this._isValid(name)
}
);
};
Please suggest.