Hi,
I am using Cakephp and Jquery for my application.
My JQuery code is
$(document).ready(function(){
var str,fields;
function showValues() {
str = $("form").serialize();
$("#results").text(str);
}
$("input").change(showValues);
showValues();
$(".submit").click(function (){
alert(str);
$.ajax({
type: "POST",
url: "http://localhost/cake_1.2.1.8004/index.php/results/submit1",
data: "str="+str,
success: function(msg){
alert( "Data Saved: " + msg);
}
});//ajax
return false;
});//submit click
});//ready
while the alert inside click of submit function displays the entrie thing eg.. _method=POST&name=a
But when i post this value and retriving in the controller its displaying only _method=POST..
My controller code is like,
function submit1($id = null)
{
echo "in ctrller ".$_POST['str'];
}
How to get the entire value in the controller and to save.. Or is there any method to retrive .. Please suggest me.....