title: zend framework 2 - compare 2 inputs using validator?
body: <p>I'm new to zend framework 2 and I have a question on comparing two inputs in the factory-backed form. My scenario is like following:</p>
  
  <p>I want to compare two inputs, for example, <code>$startDate</code> and <code>$endDate</code>. I want to validate that <code>$startDate</code> is always less than <code>$endDate</code>. How I'm going to do this? For example:</p>
  
  <pre><code>$inputFilter-&gt;add($factory-&gt;createInput(array(
                  'name'     =&gt; 'startDate',
                  'required' =&gt; true,
                  'validators' =&gt; array(
                      array(
                          'name'    =&gt; 'LessThan',
                          'options' =&gt; array(
                              'max'      =&gt; $endDate,
                          ),
                      ),
                  ),
              )));
  </code></pre>
  
  <p>FYI, I'm following the Album tutorial and the <code>$inputFilter</code> is created in the <code>classTable.php</code>.</p>
  
  <p>Thanks</p>