Reputation: 5961
I've added a new property to input that I require to be filled: data-required
(in spanish).
I have 3 or 4 in my form, I loop them this way:
$('#impFormularios').submit( function() {
$(":input[data-requerido]").each( function() {
if( $(this).val == '' ) {
alert('hola');
}
});
});
But my alert is not showing. I think it's because i'm doing something wrong with val
since the console log shows JQuery code for each item.val value (in console.log).
Thanks!
Upvotes: 2
Views: 1614