roopeshpdit
(Roopeshreddy S)
1
Hi my database(edu) has a table(patientinfo) which has a field(options) it is a enum datatype having {one,two,three} already predefined
-
How can i display {one,two,three} in check boxes one below the other
-
Is enum correct datatype to display check-boxes
zaccaria
(Matteo Falsitta)
3
For an enum field should be more appropriate a dropdown list or a radio button list, as the user cannot select more than one value.
roopeshpdit
(Roopeshreddy S)
4
Can you please let me know the datatype i should choose for checkboxes?
zaccaria
(Matteo Falsitta)
5
You should use a boolean or an int(1) for each checkbox.
Then you create your checkbox as:
<?php echo $form->checkbox($model, 'checkBoxField1');?>
<?php echo $form->checkbox($model, 'checkBoxField2');?>
<?php echo $form->checkbox($model, 'checkBoxField3');?>
<?php echo $form->checkbox($model, 'checkBoxField4');?>
where checkboxFiled1-2-3-4 are the field in database.