alterações 07-04-26
This commit is contained in:
14
main.js
14
main.js
@@ -62,21 +62,9 @@ if (currApp == 'form') {
|
||||
});
|
||||
}
|
||||
|
||||
// Aplica a máscara ao campo de telefone após o carregamento do DOM
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var phoneInput = document.getElementById('telefone');
|
||||
maskPhone(phoneInput);
|
||||
});
|
||||
|
||||
// Validação do formulário antes do envio
|
||||
document.getElementById('registrationForm').addEventListener('submit', function (e) {
|
||||
var phoneInput = document.getElementById('telefone');
|
||||
var phone = phoneInput.value.replace(/\D/g, '');
|
||||
|
||||
if (phone.length < 10 || phone.length > 11) {
|
||||
e.preventDefault();
|
||||
alert('Por favor, insira um número de telefone válido (DDD + número)');
|
||||
}
|
||||
// Validações adicionais se necessário
|
||||
});
|
||||
// Salva o cookie após o envio do formulário (quando o cadastro for completado)
|
||||
// document.getElementById('registrationForm').addEventListener('submit', function (e) {
|
||||
|
||||
Reference in New Issue
Block a user