Validação Do Campo Telefone
#1
Posted 09/04/2010, 13:05
Tenho um formulário onde tenho que validar o campo telefone. Nesse campo não pode constar sequencias do tipo (11) 1111-1111 (22) 2222-2222 e assim por diante. Tentei fazer uma validação mas não funfou. Me ajudem por favor!!!
Segue abaixo o que já fiz mas não está validando:
function checkTelefoneSequencia(telefone){
var strSeqInvalidas = new Array("00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12312312","12345678","32132132","11112222");
if(d.telefone.value == "strSeqInvalidas"){
alert("O campo " + d.telefone.name + "( Telefone Inválido");
d.telefone.focus();
return false;
}
#2
Posted 09/04/2010, 14:23
Boa tarde caros colegas:
Tenho um formulário onde tenho que validar o campo telefone. Nesse campo não pode constar sequencias do tipo (11) 1111-1111 (22) 2222-2222 e assim por diante. Tentei fazer uma validação mas não funfou. Me ajudem por favor!!!
Segue abaixo o que já fiz mas não está validando:
function checkTelefoneSequencia(telefone){
var strSeqInvalidas = new Array("00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12312312","12345678","32132132","11112222");
if(d.telefone.value == "strSeqInvalidas"){
alert("O campo " + d.telefone.name + "( Telefone Inválido");
d.telefone.focus();
return false;
}
O campo do formulário está com uma máscara?
Meu post lhe ajudou? Reputar/votar é uma das formas de agradecer.
#3
Posted 09/04/2010, 14:28
Outra coisa é que você tem que caminhar pelos registros do array para comparar cada um dos contidos.
Exemplo:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <script> function checkTelefoneSequencia(telefone){ var strSeqInvalidas = new Array("00000000","11111111","22222222","33333333"," 44444444","55555555","66666666","77777777","88888888" ,"99999999","12312312","12345678","32132132","11112222" ); for(i = 0; i <= strSeqInvalidas.length; i++){ alert if(telefone.value == strSeqInvalidas[i]){ alert("O campo " + telefone.name + " ( Telefone Inválido )"); telefone.focus(); return false; } } } </script> </head> <body> <form name="form"> <input name="telefone" type="text" maxlength="8" /> <input type="button" onclick="checkTelefoneSequencia(document.form.telefone);" value="validar" /> </form> </body> </html>
Especialidade: Desenvolvimento e Banco de Dados.
Este post lhe ajudou? Agradeça:
#4
Posted 09/04/2010, 15:28
Alguns dos telefones que você está tentando bloquear existem, eu mesmo já liguei para o 3333-3333 que é uma empresa de Taxi de Curitiba-PR ( http://www.ligtaxi.com.br/ ).
Uma máscara de entrada excelente e bastante flexível é a feita pelos desenvolvedores do JSFromHell.com, veja:
- Page Code: http://jsfromhell.co...ms/masked-input
- Sample: http://jsfromhell.co...d-input/example
#5
Posted 09/04/2010, 16:06
Obrigado
Obrigado Cristiano, vou testar.
Abraço,
Deus te abençoe.
Muito obrigado,
Vou fazer o teste...
Deus te abençoe.
#6
Posted 27/09/2017, 08:24
#7
Posted 09/10/2017, 11:47
Kamagra Prix Moyen levitra without a rx Achat Baclofen 10mg Falta Comprar Propecia En
Cheap Viagra .Can 400mg Order Celexa Online No Prescription Viagra Achat En Ligne online pharmacy Comprare Levitra Gratis Propecia For Sale In Usa Il Viagra Funziona Sempre
Propecia Industrial viagra vs cialis vs levitra Levitra Orosolubile Bayer Prezzo
#8
Posted 25/10/2017, 00:18
Levitra 20 Mg Cost Walmart online pharmacy Will Cephalexin Treat A Sinus Infection Stendra Vs Viagra Levitra Cuanto Tomar
Itch Reaction To Amoxicillin Diflucan For Sale Online cialis Lexapro Pills In Canada No Prescription Allopurinol 300 Mg Australia
#9
Posted 05/11/2017, 14:04
Buy Genuine Xenical Online Tretinoin Cream 4 Tubes Pharmacy Price online pharmacy Topical Amoxicillin For Acne Como Hacer La Propecia
Cialis Pfizer Levitra viagra Dutasteride France Drugs Free Consultation Express Delivery Dove Posso Comprare Cialis Levitra Cialis Foro
#10
Posted 04/12/2017, 23:21
Doseage For Keflex For Sinus Infection Kamagra Wiki cialis Cheap Viagra Without Prescription
Propecia Bei Kinderwunsch Isotretinoin usa price quick shipping viagra Cialis E Levitra Insieme
#11
Posted 07/11/2022, 16:24
#12
Posted 22/01/2023, 08:14
0 user(s) are reading this topic
0 membro(s), 0 visitante(s) e 0 membros anônimo(s)