1
bumciach
Multiselect with checkboxes
  • 2009/1/29 10:19

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Maybe XOOPS should replace (and suggest devs to do this in their modules) select multiple form elements with checkboxes? You know, doesn’t require user to ctrl-click multiple elements, without risk of losing those that have already been selected.
For now I can do it like this:

le="color: #000000"><?php $users_tray = new XoopsFormElementTray(_AM_PFINWEST_FZESPH ,''); $users_tray->addElement(new XoopsFormLabel('','<div style="height:150px;overflow:scroll;">')); $checkbox3 = new XoopsFormCheckBox('', 'xoops_uid[]', $xoops_uids, '<br />'); while ($row_zesp=$xoopsDB->fetchArray($result)){ $checkbox3->addOption($row_zesp['uid'], $row_zesp['uname']); } $users_tray->addElement($checkbox3); $users_tray->addElement(new XoopsFormLabel('','</div>')); $form->addElement($users_tray);

demo

Extend XoopsFormCheckBox (or XoopsFormSelect) class adding param to place checkbox elements into "overflow:scroll" with declared height and width.

By the way. It would be handy if XoopsForm renders the text assigned to the checkbox or radio clickable to select an option.
le="color: #000000"><?php <input id=il type=checkbox name=lr value="lang_pl"><label for=il> Click to check the box </label>

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits