I have following checkbox
<td><?php echo $this->Form->checkbox('purchase_owner_occupied', array('hiddenField' => false));?>Purchase owner occupied </td>
<td><?php echo $this->Form->checkbox('purchase_an_investment_property', array('hiddenField' => false));?>Purchase an investment property </td>
<td><?php echo $this->Form->checkbox('purchase_land', array('hiddenField' => false));?>Purchase Land </td>
When I check then then the post value is like below
[purchase_owner_occupied] => 1
[purchase_an_investment_property] => 1
[purchase_land] => 1
Let say I need to edit those information to uncheck purchase_land, when I uncheck purchage_land
and check remaining 2 the post value will be as below
[purchase_owner_occupied] => 1
[purchase_an_investment_property] => 1
I need to check all these value with extrastep code
if ($purchase_owner_occupied==1) { // }
Isn't there are way so that unchecked field will have 0
value like below?
[purchase_owner_occupied] => 1
[purchase_an_investment_property] => 1
[purchase_land] => 0