Here is the situation:
i have table stages
having following structure
| id | name | editable|
-----------------------------------------------------------------------------
| open | Open | 1 |
| paysheet_review | Paysheet Submitted (Awaiting Office Approval) | 0 |
| to_pay | Paysheet Approved (Awaiting Payment) | 0 |
| paid | Paid | 1 |
| purgatory | Flip or Refund | 0 |
| closed | Deal Closed | 1 |
-----------------------------------------------------------------------------
I am creating a multiple checkbox block by
In Controller
<?php $_stages = $this->Stage->find("list");?>
In View
<?php echo $this->Form->input("stage", array("multiple" => "checkbox", "options" => $_stages));?>
which creates following html
<div class="control-group">
<label class="control-label" for="DealStage">Stage</label>
<input type="hidden" value="" id="DealStage_" name="data[Deal][stage]">
<div class="controls">
<label class="checkbox"><input type="checkbox" id="DealStageOpen" value="open" name="data[Deal][stage][]">Open</label>
<label class="checkbox"><input type="checkbox" id="DealStagePaysheetReview" value="paysheet_review" name="data[Deal][stage][]">Paysheet Submitted (Awaiting Office Approval)</label>
<label class="checkbox"><input type="checkbox" id="DealStageToPay" value="to_pay" name="data[Deal][stage][]">Paysheet Approved (Awaiting Payment)</label>
<label class="checkbox"><input type="checkbox" id="DealStagesPaid" value="paid" name="data[Deal][stage][]">Paid</label>
<label class="checkbox"><input type="checkbox" id="DealStagePurgatory" value="purgatory" name="data[Deal][stage][]">Flip or Refund</label>
<label class="checkbox"><input type="checkbox" id="DealStageClosed" value="closed" name="data[Deal][stage][]">Deal Closed</label>
</div>
</div>
Now I want to pass the editable
from Database column as a title for each checkbox.
Is there any way that we create a multiple checkbox
in CakePHP and add a title
as attribute to each input type checkbox. so that I can use jQuery
to check OR uncheck
only editable Stages.