Update site-prayer.js

modify email validation regex
This commit is contained in:
Denis Volkov 2023-03-20 10:10:33 -07:00 committed by GitHub
parent 1f1751c19b
commit 3675a28791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -622,7 +622,9 @@ $(function () {
}
if (email && email.length > 0) {
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))) {
if (!(/^[a-zA-Z0-9.!#$%&*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email))) {
// old regex /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
// updated to default html5 regex
alert("You have entered an invalid email address. Please, check and try again.");
return (false);
}