-1

I have used this

       <input type="text" id="email" name="email" pattern="[a-z0-9._%+-]+[a-z0-9.-]+\.[a-z]{2,3}$" class="form-control" placeholder="Email" required>

So if email address is not in valid format then it should throw error.

it is to catch wrong email address format like name@jjjj or name or name@ or name@jj.cooooo etc

but it doesn't work i.e. it throws the message i.e. pattern must be matched even if the email is correct.

Johnny Shallow
  • 101
  • 1
  • 3
  • 12

1 Answers1

0

Use <input type="email"> to get browser support for checking.

Answer to why "johnny@gmail" is accepted:

You can theoretically have an address without a "." in

See the original answer here

handras
  • 1,548
  • 14
  • 28