E-mail validation via Pattern

Asked

Viewed 24 times

0

I would like to define the Pattern of a field so that it always validates the emails typed in the format : [email protected]

@Html.TextBoxFor(m => m.UsuarioEmail, 
new { 
      @class = "form-control", 
      id = "UsuarioEmail", 
      placeholder = "Endereço de E-mail (@minhaempresa.com.br)" , 
      ng_pattern = @"^/[a-z0-9._%+-][email protected]$/" 
})

I’m using the above, but it’s not working. How do I ?

1 answer

0


Solved.

I traded ng_pattern to just Pattern.

The expression Pattern remained:

pattern = @"^/[a-z0-9.]+[a-z0-9]@minhaempresa.com.br$/"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.