Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
custom AJAX form validation ignores empty field and submits data

Here is a great example of a form submission with a Dropzone.js and validation.

The demo itself is placed here for a long time. So I think it's not necessary to clone it to the jsFiddle

Can't find an error in the validator or other related function.

All the fields, except for Dropzone, have the validate class, so if all the fields containing this class are not filled, the form is not sent. This is related to all fields except "Full Name". If it's not filled (but others are) - the error class will be added and in spite of this, the form will try to send data! After it, an internal error will occur, because not all data was processed.

For some reason, this field is ignored...

The validation process take place in this function from scripts.js:

plannerValidate: function(e) {        
    if ("" == e.val()) return e.addClass("error"), false;
    if (!e.is('[type="email"]')) return e.removeClass("error"), true;
    var t = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e.val());
    return t ? void 0 : (e.addClass("error"), false)
}

It marks fields that contain errors but doesn't stop the form from data submission if the "Full Name" is empty

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda