qsadfasdgfgads

Untitled

Jul 12th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function success(e) {
  2.     e.preventDefault();
  3.     var phone = document.getElementById("tel");
  4.     var term = phone.value;
  5.     var re = new RegExp("^((\+7|7|8)+([0-9]){10})$");
  6.     if (phone.value != '' && re.test(term) == true) {
  7.         Swal.fire(
  8.             'Good job!',
  9.             'You clicked the button!',
  10.             'success'
  11.         );
  12.     }else{
  13.         Swal.fire(
  14.             'Good job!',
  15.             'You clicked the button!',
  16.             'error'
  17.         );
  18.     }
  19. }
Add Comment
Please, Sign In to add comment