Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#orderFormPhone').mask('\+0(000)000-00-00');
- $('#orderFormName').mask("A", {
- translation: {
- "A": { pattern: /[a-zA-Z А-Яа-яёЁ]/, recursive: true }
- }
- });
- $('#orderFormCity').mask("A", {
- translation: {
- "A": { pattern: /[a-zA-Z А-Яа-яёЁ]/, recursive: true }
- }
- });
- $('#orderFormEmail').mask("A", {
- translation: {
- "A": { pattern: /[\w@\-.+]/, recursive: true }
- }
- });
- //doc mask -> http://igorescobar.github.io/jQuery-Mask-Plugin/docs.html
- $('#orderFormEmail').on('blur', function () {
- let email = $(this).val();
- if (email.length > 0
- && (email.match(/.+?\@.+/g) || []).length !== 1) {
- console.log('invalid');
- alert('Вы ввели некорректный e-mail!');
- } else {
- console.log('valid');
- alert('Вы ввели корректный e-mail!');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement