Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda