0
Good afternoon,
I have this simple code below using js but it returns me the error that is in the print below:
I am using Codeigniter 3.0.10, Ajaxm jQuery 3.0.0 Minifed and Bootstrap 4
**Code:*
jQuery(document).ready(function() {
var base = $("#base_url").val();
$('#telefone').mask('(99) 99999-9999');
jQuery("#form-registrar-estilo").submit(function(e) {
e.preventDefault();
var email_validar = $("#email").val();
for (let el of jQuery('#form-registrar-estilo input')) {
if (el.value == "") el.classList.add("error");
else el.classList.remove("error");
}
if (!jQuery('#form-registrar-estilo input.error').length) {
jQuery.ajax({
url: base + "painel/cadastrar/valida_email",
type: "POST",
data: {email:email},
dataType: "json",
success: function(data) {
alert(data);
}
})
};
});
});