i plan to set a checkbox with selected option in my form.
but i am unable to show my checkbox content in the form, i cant see any value instead of just a box for me to select.
how to show value while i using checkbox? i able to show my value while i using select.
this is in a HABTM model. any hints?
here is my selection code.
input(‘User’,array(‘label’
=> ‘Select Related Potential’,
‘multiple’=>’checkbox’,
//’options’ => $users,
‘legend’=>$users,
//’value’=>$users,
//’id’=>$ownUserId,
‘default’=>$ownUserId,
‘style’=>’width:200px;height:100px’,
‘selected’ => $ownUserId, )); ?>
This may be relevant:
For example:
Causes the field to have the value
true, which will result in a checked checkbox for this field.Or:
Always checks the checkbox.
Or:
Dynamically sets the checkbox based on whether
$this->data['Model']['field']is ‘xxx’ or not.Sorry, completely misunderstood the question.
Did you find your users via
list? The options array needs to be in a particular format, a normalfind()won’t do that.