×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Gábor Papp
Added: Feb 27, 2021 8:27 AM
Modified: Feb 27, 2021 8:49 AM
Views: 4758
Tags: no tags
  1. {literal}function validateEmail_easy(email) {
  2.     alert('email '+email);
  3.     var re = /\S+@\S+\.\S+/;
  4.     return re.test(email);
  5. }
  6. function validateEmail(email) {
  7.   const re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
  8.   return re.test(email);
  9. }
  10.  
  11.     if (!validateEmail(urlap.email.value)) {
  12.         alert('Az e-mail cím nem megfelelő formátum!');
  13.         return false;
  14.     }
  15.  
  16. {/literal}