$( ':input[required]', yourForm ).each( function () {
if ( this.value.trim() !== '' ) {
// ...
}
});
where yourForm is a reference to the FORM element (you can also use a selector here). This is the context - you only want to search for fields inside the form.