title: Check Aui form with javascript function before aui Validator in Liferay
body: <p>I have this form.</p>
  
  <pre><code>&lt;aui:form action="&lt;%=addRequestURL%&gt;" method="post" name="fm" &gt;
              &lt;!-- aui:input fields --&gt; 
              // aui:validator
  
  
              &lt;!-- input fields --&gt;
             //validation with a function (jQuery)
  
      &lt;aui:button id="checkFields" value="submit" type="submit" disabled="&lt;%=fieldsDisabled %&gt;"/&gt;
  &lt;/aui:form&gt;
  </code></pre>
  
  <p>And I'm using Aui Validators to validate the fields.</p>
  
  <p>And then, I have a javascript function : </p>
  
  <pre><code>&lt;aui:script use="aui-base"&gt;
  jQuery(function($) {    
      $(document).ready(function() {
      $("#checkFields").click(function(){
  
          var result1=A.one("#&lt;portlet:namespace/&gt;FieldA").get("value");
          var result2=A.one("#&lt;portlet:namespace/&gt;FieldAFieldB").get("value");
  
          if (result1&lt; result2){ 
             alert('I will not submit');
            //Not Submit the Form
             return false;}
  
          });
      }); 
  });
  &lt;/aui:script&gt;
  </code></pre>
  
  <p>I just have to check the result of the the JavaScript function before to submit the form and before validation.
  If this function return false, the form submission will not be executed.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks in advance.</p>