Find children with text

Find children with text

Sometimes my helpers make nodes like this:

  1. <div class="col-md-2 col-md-offset-1">
            <span class="control-label required">First name</span>
            <input type='text' class="form-control" value=""  >
    </div>

And sometimes they make nodes like this:

  1. <div class="col-md-2 col-md-offset-1">               
            <span class="control-label required">Date of birth</span>
            <div class="input-group date">
                <input type='text' class="form-control class_date_input" placeholder="mm/dd/yyyy" value=""  >
                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
            </div>
        </div>

I want my submit function to traverse each input where the value is blank and alert the user with the adjacent text.  Sometimes that text is the input's sibling and sometimes it's the sibling of a parent.  So, I'm looking for the closest parent of a child with text and I want to return that child.  Here's the best I have so far:
  1. $("button").click(function(){
            $("input").each(function(){
                if ($(this).val() == '')
                    alert($(this).closest("*>:has(*[text!=''])").first().prev().text().trim() + ' is blank.')
            });
        });

It works fine in the second instance, but in the first it returns the previous input's text.

Thank you for your help.