0

I am using AngularJS's form validation and have the following e-mail input

<input type="email" />

This uses the AngularJS email regex validation but it still allows invalid emails

Example the following e-mail should be invalid but is passing as valid: test@test

I need to create a regex (ng-pattern) that forces a domain. eg name@domian.com

I also want the regex to allow custom domains like name@custom.name

Curzon
  • 113
  • 1
  • 1
  • 4
  • Duplicate of http://stackoverflow.com/questions/46155/validate-email-address-in-javascript?rq=1 – Andrew Sep 27 '16 at 22:50
  • Andrew, the duplicate question you pointed to does not answer my question of forcing a domain in the regex. I want to force a .com etc.. those regexs still allow test@test – Curzon Sep 27 '16 at 23:20
  • find your own regex and use `ng-pattern` on a text input. *"email regex"* has tons and tons of results in a web search ... or if you have a server side one do remote validation – charlietfl Sep 27 '16 at 23:25
  • charliettifl, please point me to a web search result that answers my question of forcing a domain in the email. I couldn't find a result which is why I asked on here. – Curzon Sep 27 '16 at 23:40

0 Answers0