validate the phone number

This commit is contained in:
Matteo Manzinello 2020-07-10 12:51:58 +02:00
parent 76e7ddcd30
commit c0d13a39c7

View File

@ -482,6 +482,9 @@ const mailgoRender = (type = MAIL_TYPE, mailgo: HTMLLinkElement): void => {
msg = mailgo.getAttribute("data-msg"); msg = mailgo.getAttribute("data-msg");
} }
// validate the phone number
if (!validateTel(tel)) return;
// information // information
// let titleEl = getE("m-tel-title"); // let titleEl = getE("m-tel-title");
@ -882,7 +885,7 @@ const validateEmails = (arr: string[]): boolean => arr.every(validateEmail);
// validate a single tel with regex // validate a single tel with regex
const validateTel = (tel: string): boolean => { const validateTel = (tel: string): boolean => {
// TODO // TODO: find a good regex for telephone numbers
return true; return true;
}; };