title: How to select the value of the label for a form field
body: <p>I'm stuck on this one. I'd like to grab the <strong><em>value of the label</em></strong> for a field to use it in an alert as part of a validation script. Here is my code:</p>
  
  <p>(The function is being called on the <code>onblur</code> event (<code>isFieldBlank(this)</code>).</p>
  
  <pre><code>function isFieldBlank(that) {
      if($(that).val()=="") {
        var fieldLabel = $('label[for*="' + that + '"]).val();
        alert(fieldLabel);
        alert("You must provide a value for: ") + fieldLabel;
        $(that).addClass("error");
        $(that).focus();
        return false;
      } else {
          $(that).removeClass("error");       
      }
  }
  </code></pre>