title: No data in response for a ajax action in ZF2 Controller
body: <p>The problem is that I don't have data in controller, in filterAction function.</p>
  
  <p>I can see in firebug at Post:</p>
  
  <pre><code>Source: daterange=2015%2F10%2F22+-+2015%2F10%2F22
  </code></pre>
  
  <p>at Response:</p>
  
  <pre><code> {"daterange":null,"submit":null}
  </code></pre>
  
  <p>In the response at daterange I want to be the date range which I introduced in interface.</p>
  
  <p>Here is the ajax call</p>
  
  <pre><code>     &lt;script type="text/javascript"&gt;
      $(function(){
          $('#incidents').bind("submit",function(event) {
              event.preventDefault();
  
              var urlform = '&lt;?php echo $this-&gt;url('incidents', array('controller'=&gt;'IncidentsController', 'action'=&gt;'filter')); ?&gt;';
  
              $.ajax({
                  url: urlform,
                  type: 'POST',
                  dataType: 'json',
                  contentType: "application/json; charset=utf-8",
                  async: true,
                  data: ($("#incidents").serialize()),
                  success: function (data) {
                      console.log(data);
                  },
                  error: function (data) {
                      console.log(data);
                  }
              });
          })
      })
  &lt;/script&gt;
  </code></pre>
  
  <p>Here's the Form:</p>
  
  <pre><code>    &lt;?php
   namespace Incidents\Form;
  
   use Zend\Form\Form;
  
   class IncidentsForm extends Form
   {
       public function __construct($name = null)
       {
           // we want to ignore the name passed
           parent::__construct('incidents');
           $this-&gt;setAttribute('method', 'post');
  
  
          $this-&gt;add(array(
              'type' =&gt; 'text',
              'name' =&gt; 'daterange',
              'options' =&gt; array(
                      'label' =&gt; 'Start Time'
              ),
          ));
  
          $this-&gt;add(array(
              'name' =&gt; 'submit',
              'type' =&gt; 'Submit',
              'attributes' =&gt; array(
                  'value' =&gt; 'Filter',
                  'id' =&gt; 'submitbutton',
              ),
          ));
       }
   }
  </code></pre>
  
  <p>Here is the filterAction() on the controller:</p>
  
  <pre><code>public function filterAction()
  {
      $form = new IncidentsForm();
      $request = $this-&gt;getRequest();
      $response   = $this-&gt;getResponse();
  
      if ($request-&gt;isPost()){
          $form-&gt;setData($request-&gt;getPost());
  
          if ($form-&gt;isValid()) {
              $formData = $form-&gt;getData();
          }
      }
  
     return $response-&gt;setContent(\Zend\Json\Json::encode($formData));
  }
  </code></pre>
  
  <p>I'm expecting that in $formData to have the date range which I selected in interface from the daterangepicker control. 
  Can some one help me, plese? </p>