I have some checkboxes with class='chkspec' and I would to pass the ID value of the clicked checkbox to a xxx.php file. My problems are:
1) I don't know how to pass the ID I tried with "specificitem=this.id" but I'm not sure it is the right way
2) I get this error: Undefined variable: specificitem. This occur also if I do specificitem="hello";
code is below.
if ($('.chkspec').is(":checked")) {
xmlHttp.open('POST', "xxx.php", true);
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200)
{
data: {specificitem : this.id }
}
}
};
Thank you for replies.