Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkbox group #40

Closed
applesy16g opened this issue Jun 1, 2012 · 1 comment
Closed

checkbox group #40

applesy16g opened this issue Jun 1, 2012 · 1 comment

Comments

@applesy16g
Copy link

Checkbox for array options.

$sample = array(
  'a' => array(
    '1' => 1,
    '2' => 2,
    '3' => 3,
  ),
  'b' => array(
    '10' => 10,
    '11' => 11,
    '12' => 12,
    '13' => 13,
  ),
);
echo $this->Form->input('sample', array('type'=>'select', 'multiple' => 'checkbox', 'options' => $sample));

This work.

<label class="checkbox">a</label> 
<label class="checkbox"><input type="checkbox" name="data[Shop][sample][]" value="1" id="ShopSample1">1</label> 
<label class="checkbox"><input type="checkbox" name="data[Shop][sample][]" value="2" id="ShopSample2">2</label> 
<label class="checkbox"><input type="checkbox" name="data[Shop][sample][]" value="3" id="ShopSample3">3</label> 
</fieldset> 
<label class="checkbox">b</label> 
<label class="checkbox"><input type="checkbox" name="data[Shop][sample][]" value="10" id="ShopSample10">10</label> 
<label class="checkbox"><input type="checkbox" name="data[Shop][sample][]" value="11" id="ShopSample11">11</label> 
<label class="checkbox"><input type="checkbox" name="data[Shop][sample][]" value="12" id="ShopSample12">12</label> 
<label class="checkbox"><input type="checkbox" name="data[Shop][sample][]" value="13" id="ShopSample13">13</label> 
</fieldset> 

Ideal work.

<fieldset><legend>a</legend> 
<div class="checkbox"><input type="checkbox" name="data[Sample][sample][]" value="1" id="SampleSample1"><label for="SampleSample1">1</label></div> 
<div class="checkbox"><input type="checkbox" name="data[Sample][sample][]" value="2" id="SampleSample2"><label for="SampleSample2">2</label></div> 
<div class="checkbox"><input type="checkbox" name="data[Sample][sample][]" value="3" id="SampleSample3"><label for="SampleSample3">3</label></div> 
</fieldset> 
<fieldset><legend>b</legend> 
<div class="checkbox"><input type="checkbox" name="data[Sample][sample][]" value="10" id="SampleSample10"><label for="SampleSample10">10</label></div> 
<div class="checkbox"><input type="checkbox" name="data[Sample][sample][]" value="11" id="SampleSample11"><label for="SampleSample11">11</label></div> 
<div class="checkbox"><input type="checkbox" name="data[Sample][sample][]" value="12" id="SampleSample12"><label for="SampleSample12">12</label></div> 
<div class="checkbox"><input type="checkbox" name="data[Sample][sample][]" value="13" id="SampleSample13"><label for="SampleSample13">13</label></div> 
</fieldset> 

Nothing fieldset start tag.
Please a solution to a problem.

@slywalker
Copy link
Owner

Development of this plugin has moved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants