Hi all,
I have some checkboxes and drop downs generated by php, the problem I am having is that on the check boxes which look like this:
echo "<p>The price for Service 1is: £$service1priceprice, type of rate: $haircolourtype Tick the box if you want to enquire on this service:<input type=\"checkbox\" name=\"haircolourselected\" value=\"true\"</p>";
When the page gets submitted however, the checkbox returns blank and of course as a result of this code setting up the post variables will enter a null value into the database instead of tru:
if (!isset($_POST['service1selected'])) {
$service1selected = 'null';
}else{
$service1selected = $_POST['service1selected'];
}
How can I set the checkbox to be set when clicked for form submission?
Thanks,
G