Helly ladies and gents,
I have a dynamic set of 120 checkboxes that are rendered with php:
[code=php]echo “<input type=”checkbox” id=””. $prosubline[“sku”] .”” value=”” . $prosubline[“price”] .”” name=”products[]”/>n”;
– I have the ID attribute to have the SKU number of the product– I have the VALUE has the price so a javascript function will display the total as the click on the desired product on the fly– I have the NAME attribute so PHP will render my “products[]” array on a results page with the follwing code:
[code=php]
echo “<p>here are the products you selected:</p>”;
$real_selection = “”;
foreach ($_POST[“products”] as $id)
{
if ($real_selection)
$real_selection .= “, “.trim($id);
else
$real_selection = trim($id);
}
echo $real_selection;
The problem is that the results page displays the checked products but displays the prices in a sentence which is what the VALUE attribute on the form has. Is it possible for PHP to fetch the ID value instead of the actual VALUE attribute from the checkbox field so I can have the SKU of the products? I am trying to fetch those values into a QUERY on the results page if I can get that to work. any suggestions..are appreciated :rolleyes: