Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function success(e) {
- e.preventDefault();
- var phone = document.getElementById("tel");
- var term = phone.value;
- var re = new RegExp("^((\+7|7|8)+([0-9]){10})$");
- if (phone.value != '' && re.test(term) == true) {
- Swal.fire(
- 'Good job!',
- 'You clicked the button!',
- 'success'
- );
- }else{
- Swal.fire(
- 'Good job!',
- 'You clicked the button!',
- 'error'
- );
- }
- }
Add Comment
Please, Sign In to add comment