+1 vote
by
Help me figure out why this if condition doesn't want to work:
I need to take all input type=text except those with the disabled attribute
if (!$('.activity-content input[type=text]:not(input:disabled)').val()) {
reasons.push("lorem ipsum");
}

var requiredField = $('.activity-content-item').find('[required=required]');
for (var i = 0; i < requiredField.length; i++) {
if ($(requiredField[i]).val() == '') {
$(requiredField[i]).addClass('error');
}
}

1 Answer

0 votes
by
 
Best answer
:not(:disabled)
The input was unnecessary
...