<div class="fluid field">
<label>e-mail Ids:</label>
<textarea rows="1" style="height:100px" id="mailids" value="<%- mailids %>"></textarea>
</div>
below is my JS code which i tried
'change #mailids': function (e) {
var strVale = $(e.target).val();
if (strVale.substring(strVale.length - 1) == ";") {
strvalue = strVale.substring(0, strVale.length - 1);
}
var arr = strVale.split(';');
var isValid = true;
var self = this;
arr.forEach(function (item) {
var x = item;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length) {
isValid = false;
}
});
}
I need to validated the two email id separated by ;
(semi colon) if its not valid email it should show error message
below input also accepts as valid