After making the ajax call, i try to recover the values, but returns null
this is function inside controller
public function checkAction()
{
# Retrieve value
//$checkbox = Mage::app()->getRequest()->getPost('checkbox');
//$checkbox = Mage::app()->getRequest()->getParam("checkbox");
//$checkbox = $this->getRequest()->getParam("checkbox");
$checkbox = $this->getRequest()->getPost("checkbox");
Mage::log($checkbox);
//response
$response = array('namecheck' => $checkbox);
# Send response Json
$this->getResponse()->setHeader('Content-type', 'application/json');
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
}
this is ajax call
new Ajax.Request('<?php echo $ajaxUrl; ?>', {
method: 'POST',
data: {
ajax : true,
checkbox : id_var,
value : value_var,
},
onSuccess: function(transport) {
alert('Sent notification.');
},
onFailure: function(transport) {
alert("Couldn't send a notification. ");
}
});
tips ? I tried both getPost & getParams and method: 'POST' & method: 'GET'
Log: null
Payload response: {"namecheck":null}