* @package HTML_QuickForm_advmultiselect * @subpackage Examples * @access public * @example examples/qfams_custom_7.php * qfams_custom_7 source code * @link http://www.laurent-laville.org/img/qfams/screenshot/custom7.png * screenshot (Image PNG, 640x525 pixels) 160 Kb */ require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/advmultiselect.php'; $form = new HTML_QuickForm('amsCustom7'); $form->removeAttribute('name'); // XHTML compliance $fruit_array = array( 'apple' => 'Apple', 'orange' => 'Orange', 'pear' => 'Pear', 'banana' => 'Banana', 'cherry' => 'Cherry', 'kiwi' => 'Kiwi', 'lemon' => 'Lemon', 'lime' => 'Lime', 'tangerine' => 'Tangerine', ); // rendering with QF renderer engine and template system $form->addElement('header', null, 'Advanced Multiple Select: custom layout '); $ams =& $form->addElement('advmultiselect', 'fruit', null, $fruit_array, array('class' => 'pool', 'style' => 'width:200px;') ); $ams->setLabel(array('Fruit:', 'Available', 'Selected')); $ams->setButtonAttributes('add' , 'class=inputCommand'); $ams->setButtonAttributes('remove' , 'class=inputCommand'); $ams->setButtonAttributes('all' , 'class=inputCommand'); $ams->setButtonAttributes('none' , 'class=inputCommand'); $ams->setButtonAttributes('toggle' , 'class=inputCommand'); $ams->setButtonAttributes('moveup' , 'class=inputCommand'); $ams->setButtonAttributes('movedown', 'class=inputCommand'); // template for a single checkboxes multi-select element shape $template1 = '
{label_3} | |
---|---|
{selected} | {all} {none} {toggle} |
{label_2} | {label_3} | |
---|---|---|
{unselected} |
{add} {remove} {all} {none} {moveup} {movedown} |
{selected} |
'; print_r($clean); echo ''; } $form->display(); ?>