title: Struts 2 Validation - Do expression & fieldexpression validators support automatically rendering client-side for OGNL expressions?
body: <p>Do the Struts 2 <code>expression</code> and/or <code>fieldexpression</code> validators support automatically rendering client-side ECMAScript/JavaScript validation for the OGNL expression defined in the validation XML file, like what is done for the other <a href="http://struts.apache.org/2.0.14/docs/validation.html#Validation-BundledValidators" rel="nofollow noreferrer">bundled validators</a> (<code>requiredstring</code>, <code>stringlength</code>, etc.)?</p>
  
  <p>I ask, because the following ECMAScript is rendered for client-side for this form, and I don't see my OGNL expression anywhere.  I've tried the <code>expression</code> and <code>fieldexpression</code> validators and they both render this:</p>
  
  <pre><code>function validateForm_dlgIdSearch_form() {
      form = document.getElementById("dlgIdSearch_form");
      clearErrorMessages(form);
      clearErrorLabels(form);
  
      var errors = false;
      var continueValidation = true;
      // field name: searchFilter.number
      // validator name: fieldexpression
      if (form.elements['searchFilter.number']) {
          field = form.elements['searchFilter.number'];
          var error = "Employee number is required.";
      }
  
      return !errors;
  }
  </code></pre>
  
  <p>I am trying to require at least one of three search fields, and I'm not sure if I've made a mistake or if Struts 2's validation doesn't support automatic client-side ECMAScript generation for <code>expression</code> and <code>fieldexpression</code> validators.</p>