title: Form submission in cakephp using JQuery
body: <p>I have created the Form as like</p>
  
  <pre><code>&lt;?php echo $form-&gt;create('Result',array('action'=&gt;'submit'));?&gt;
      //some input text fields,texarea fields
      &lt;?php echo $form-&gt;end('submit');?&gt;
  </code></pre>
  
  <p>In my JQuery code, i have written like,</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function(){
          var str,fields;
          function showValues() {
              str = $("form").serialize();
              $("#results").text(str);
          }
  
          $(".submit").click(function (){
              alert(str);
              $.ajax({
                  type: "POST",
                  url:"/results/submit"
                  data: "str="+str,
                  success: function(msg){
                      alert( "Data Saved: " + msg);
                  }
  
              });
              return false;
          });//submit click
      });//document ready
  &lt;/script&gt;
  </code></pre>
  
  <p>Edit: Added Url to the Ajax,</p>
  
  <pre><code>  Now when i click the submit button it alerts str correctly.. 
    Like my alert value is 
        _method=POST&amp;name1=value1&amp;name2=value2 
  
    But in the next alert of Data saved it shows only the _method=POST 
  </code></pre>
  
  <p>In my Results Controller</p>
  
  <pre><code> &lt;?php
  class ResultsController extends AppController 
  {
  
  var $name = 'Results';
  var $helpers=array('Html','Ajax','Javascript','Form');
  var $components = array( 'RequestHandler','Email');
  var $uses=array('Form','User','Attribute','Result');
     function submit($id = null)
     {
  
      $str=$_POST['str'];
      echo "POSTED value ".$str;
     // echo $this-&gt;params['form']['str'];
    }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>and my Results Table is having (id,form_id,attribute_id,label(eg .name1,name2),value(eg...value1,value2) )
  </code></pre>
  
  <p>Please suggest me..
  Any suggestions?</p>