SHARE
TWEET

Untitled

a guest Jun 25th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function looksLikeMail(str) {
  2.       var patt = new RegExp(/^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([^<>()[].,;:s@"]+.)+[^<>()[].,;:s@"]{2,})$/i);
  3.       return patt.test(str);
  4.     }
  5.  
  6. var c1;
  7. var c2;
  8. var error = false;
  9. c1 = document.getElementById("t8").value;
  10. c2 = document.getElementById("t9").value;
  11. if (document.getElementById("t8").value != "" || document.getElementById("t9").value != ""){
  12.      if (document.getElementById("t8").value != ""){
  13.      var validE;
  14.      validE = looksLikeMail((String)(t8));
  15.      if (!validE){
  16.         error = true;
  17.         alert("invalid email address");
  18.        }
  19. }
  20.      
  21. <div class="form-row">
  22.   <label class="col align-self-center">&nbsp;<b>email (at least one)</b></label>
  23.   </div>
  24.  
  25.  
  26.   <div class="form-row">
  27.   <div class="col-md-6 offset-md-3">
  28.   <label for="inputEmail4">email-1</label>
  29.   <input type="email" class="form-control" id="t8" placeholder="email">
  30.   </div>
  31.  
  32.   <div class="col-md-6 offset-md-3">
  33.   <label for="inputEmail5">email-2</label>
  34.   <input type="email" class="form-control" id="t9" placeholder="email">
  35.   </div>
  36.   </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top