javascript - Textbox to accept only one @ -


i'm creating email field in html, can accept 1 @?

for example email:

chong!#$@gmail.com - should invalid because of there others special characters included

or

ch@ng@gmail.com - should invalid because there 2 @'s.

the accepted special character should 1 @, how do in javascript/jquery? sorry don't know in regex. or there way validate email format?

you can use following regex in input:

 <input type="email" pattern="[a-za-z0-9.]+\@[a-za-z0-9.]+\.[a-za-z]+" /> 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -