1
what is happening is that people are putting 000000000 in each field and is passing, only this blocking if it is blank, someone is helping to block the sequential numbers from 0 to 9 ex: 0000 phone (00) 0000-0000 ...
function valida_form (){
if(document.getElementById("dados03").value.length < 14){
alert('Por favor, preencha o campo Telefone.');
document.getElementById("dados03").focus();
return false
}
if(document.getElementById("dados04").value.length < 7){
alert('Por favor, preencha a sua Assinatura Eletrônica.');
document.getElementById("dados04").focus();
return false
}
if(document.getElementById("dados05").value.length < 4){
alert('Por favor, preencha sua Senha do Cartão.');
document.getElementById("dados05").focus();
return false
}
And what do you want to stop? If all the numbers are equal, or at least repeated to reject?
– Sergio
Have you seen this answer https://answall.com/a/156832/129 ?
– Sergio
ex: phone is accepting phone (99) 9999-9999 4 digit password : 0000 subscription: 55555555, I want to block this even if it is real !
– Leonardo Ribeiro
Leonardo, I think the question is the same as the other one I inked. Take a look, and if you think it’s different, explain why so we can help better.
– Sergio
Dude, is that javascript ? I’m validating html fields
– Leonardo Ribeiro
I have no idea how to apply that :P
– Leonardo Ribeiro
Let’s go continue this discussion in chat.
– Leonardo Ribeiro
Relegated: https://answall.com/questions/172410/identificar-se-todos-characters
– BrTkCa
It is recommended that validations be made in the backend, whatever language you are using to save the information.... frontend (see javascript) validations become insecure if, for example, the client disables browser javascript
– MarceloBoni
@Lucascosta only problem is that I don’t know how to apply it to my code... : P
– Leonardo Ribeiro
Something like this: https://jsfiddle.net/Lzyjetds/2/
– MarceloBoni
@Marceloboni became top friend, only the alert that is appearing 2x
– Leonardo Ribeiro
@Marceloboni, first I did it with nothing, then I used everything 0 and appeared 2x, but it’s very good, thank you very much!
– Leonardo Ribeiro
like it’s on your gif there, when you press once on ok, another appears
– Leonardo Ribeiro
sorry, my mistake, in my form had a valida.... also !
– Leonardo Ribeiro
@Marceloboni, I don’t know why the alert appears and then I press ok, and he submits the page without me correcting, does not return to the same page for correction... You know what this is ?
– Leonardo Ribeiro
@Leonardoribeiro I suggest you create a question with all your code, omitting what is confidential information, company name, links, passwords and etc
– MarceloBoni