I know the title is a bad title, I don’t know any way to explain this other than with an example:
$('form').submit(function(){
$(this).find('input').each(function(){
if($(this).hasClass('error'))
return false;
});
});
However, the “return false” is returning the “.each()” with false. How can I “pass” it onto the “.submit()”?
If you’re looking for any input in that form that has the class error, you could do: