The best way to do it is to use an encoded JSON object or an AJAX call. The AJAX call is pretty straight forward, but the use of a JSON object is recommended due to it’s ease of use and limited calls to the script.
$arrayObject = array(‘id’ => $objectId, ‘name’ => $objectName, ‘price’ => $objectPrice, ‘description’ => $objectDescription);
<span><input name=’object’ type=’checkbox’ value='<?=json_encode($arrayObject)?>’></span>
var decodedArray = eval(‘(‘+checkedItems[i].value+’)’);
var id = decodedArray.id;
var name= decodedArray.name;
var price= decodedArray.price;
var description= decodedArray.description;