PageSourceSearch

https://www.fsjunior.com/Scripts/formValidator.js?v=iqXeylDD4llkhrNfobr2TCReVP1D1S60tzQ3wL-fJww

js fsjunior.com collected 2026-10-01 16:24:27 UTC 1,034 bytes, 25 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function() {
2    // Выбираем все формы с классом 'form'
3    var forms = document.querySelectorAll('.form');
4
5    forms.forEach(function(form) {
6        form.addEventListener('submit', function(event) {
7            var isValid = true;
8
9            // Проверка телефона (только цифры, пробелы и +)
10            var phoneInput = form.querySelector('input[name="Phone"]');
11            if (phoneInput) {
12                var phoneValue = phoneInput.value.trim();
13                if (!/^[\d\s\+]+$/.test(phoneValue)) {
14                    alert('Номер телефона может содержать только цифры, пробелы и "+".');
15                    isValid = false;
16                }
17            }
18
19            // Если валидация не прошла, отменяем отправку формы
20            if (!isValid) {
21                event.preventDefault();
22            }
23        });
24    });
25});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.