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:

$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.
<input id=il type=checkbox name=lr value="lang_pl"><label for=ilClick to check the box </label>

Login

Who's Online

216 user(s) are online (138 user(s) are browsing Support Forums)


Members: 0


Guests: 216


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits