59
Views
1
Comments
Validation EmailAddressValidate

I'm using the function EmailAddressValidate()  to validate email and I don't know why Outsystems consider a empty record like valid.

EmailAddressValidate("") return True

I know that I can use regex or using Length() function to validate first to check if the Email Size is greater than zero, but I think the return of this function should be improved

Comparing for example with the java library javax.mail.internet.InternetAddress:

InternetAddress emailAddr = new InternetAddress("");

emailAddr.validate();

a empty email is not considered valid, and well.

2021-07-05 14-07-53
Gonçalo Duque

That is actually stated in the action description as well. I agree it is unfortunate, needing to have the extra validation. If your field is mandatory you don't actually have this concern otherwise the extra validation is needed.

This follows the HTML5 validation found here https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.