24 lines
689 B
JavaScript
24 lines
689 B
JavaScript
var result={};
|
|
result.isValid=true;
|
|
|
|
if (( workitem.get("txtcomment") == null || ''==workitem.get("txtcomment")[0]) ) {
|
|
result.isValid=false;
|
|
result.errorMessage='Bitte geben Sie einen Kommentar ein.';
|
|
}
|
|
|
|
if (workitem['dbtr.mail'] && workitem['dbtr.mail'].length>0) {
|
|
var liste=workitem.get("dbtr.mail");
|
|
for (i = 0; i < liste.length; i++) {
|
|
validateMail(liste[i]);
|
|
}
|
|
}
|
|
|
|
|
|
function validateMail(mail) {
|
|
if (/^(?=.{1,64}@)[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)*@[^-][A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,})$/.test(mail)) {
|
|
// OK
|
|
} else {
|
|
result.isValid=false;
|
|
result.errorMessage='Bitte geben Sie eine gültige E-Mail Adresse ein ('+ mail + ')!';
|
|
}
|
|
}
|