Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29935

Restrict user to enter English only text input, no other language in react native

$
0
0

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.

Thank you. keyboard has an option of Japanese


Viewing all articles
Browse latest Browse all 29935

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>