Hello I am a newbie working with jQuery and Ajax. I am trying submit data to the server using Jquery POST method. And the data that I am passing is a string. Now I am unable
The data param is supposed to be an object that has keys and values.
var data = {
hiddenContact: document.getElementById('hiddenContact').value
}
$.post('/callcenter/admin/postContacts', data);
Then in PHP you can retrieve it like this:
$hiddenContact = $_POST["hiddenContact"];
I'm not a big CakePHP user but I believe the CakePHP version is like this:
$hiddenContact = $this->params["hiddenContact"];