regex - DataAnnotation TextArea Multiple Emails -


i using mvc 3.

i have text area in user can enter multiple emails addresses. emails can separated comma , space. user may hit enter in box well.

  1. is there attribute can handle scenario?

  2. i using regular expression check characters , failing "abc@abc.com, tyz@tyz.com"

here regular expression: [regularexpression(@"([a-za-z0-9 .@-_\n\t\r]+)", errormessage = validationmessageconstants.emailadressinvalid)]

what missing here? regular expression off following post: dataannotations validation (regular expression) in asp.net mvc 4 - razor view

you not stating question is, have assume answer data annotations aren't working expect.

having assumption in mind, easy why not working: data annotation operates on entire field, text area in case. work expected if have 1 email. since have multiple emails in field, separated comma or space, field in entirety doesn't reflect data annotation email prescribes , fails.

to answer numbered questions:

  1. no, there no out of box

  2. the regular expression using doesn't account multiple emails, one. solution in case either

following links above see examples of "how to" , going in right direction. hope helps, please let me know if not.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -