Question
Closed
Edit validate for multiple email entry validation
Hi! I would like to add multiple email address and have them separated by a comma. How can this be done in edit validate? can anyone help me out to validate the multiple entries?
***Edited by Moderator Marissa to change type from General to Product, update Product details and Platform Capability tags****
To see attachments, please log in.
Hi
You can try something like below:
String theValue = " Proprietary information hidden, Proprietary information hidden";
String[] test = theValue.split(",");
for (int i = 0; i < test.length; i++) {
try {
javax.mail.internet.InternetAddress emailAddr = new javax.mail.internet.InternetAddress(test);
emailAddr.validate();
}
catch (javax.mail.internet.AddressException ex){
return false;
}
}
}
The String "theValue" will be the actual value from the property, so that can be removed in your rule.
Regards
Bhavya