Source for file qfams_basic_1.php
Documentation is available at qfams_basic_1.php
* Basic advMultiSelect HTML_QuickForm element
* without any customization.
* @version $Id: qfams_basic_1.php,v 1.4 2008/04/26 17:25:59 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
* @package HTML_QuickForm_advmultiselect
* @example examples/qfams_basic_1.php
* qfams_basic_1 source code
* @link http://www.laurent-laville.org/img/qfams/screenshot/basic1.png
* screenshot (Image PNG, 406x247 pixels) 4.95 Kb
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/advmultiselect.php';
$form = new HTML_QuickForm ('amsBasic1');
$form->removeAttribute ('name'); // XHTML compliance
// same as default element template but wihtout the label (in first td cell)
<!-- BEGIN error --><span style="color: #ff0000;">{error}</span><br /><!-- END error -->{element}
// replace default element template with label, because submit button have no label
$renderer = & $form->defaultRenderer ();
$renderer->setElementTemplate ($withoutLabel, 'send');
// rendering with all default options
$form->addElement ('header', null , 'Advanced Multiple Select: default layout ');
$form->addElement ('advmultiselect', 'cars', 'Cars:', $car_array);
if (isset ($_POST['cars'])) {
$form->setDefaults (array ('cars' => $_POST['cars']));
$form->addElement ('submit', 'send', 'Send');
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>HTML_QuickForm::advMultiSelect basic example 1</title>
font-family: Verdana, Arial, helvetica;
$clean = $form->getSubmitValues ();
Documentation generated on Sat, 26 Apr 2008 14:30:08 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|