cvs: peardoc /en/package/html/html-quickform-advmultiselect/appendix examples-custom5.xml
[email protected] ("Laurent Laville")
| Newsgroups | php.pear.doc |
|---|---|
| Message-ID | <cvsfarell1233263839@cvsserver> |
farell Thu Jan 29 21:17:19 2009 UTC
Modified files:
/peardoc/en/package/html/html-quickform-advmultiselect/appendix
examples-custom5.xml
Log:
sync with qfams_custom_5.php,v 1.6
http://cvs.php.net/viewvc.cgi/peardoc/en/package/html/html-quickform-advmultiselect/appendix/examples-custom5.xml?r1=1.2&r2=1.3&diff_format=u
Index: peardoc/en/package/html/html-quickform-advmultiselect/appendix/examples-custom5.xml
diff -u peardoc/en/package/html/html-quickform-advmultiselect/appendix/examples-custom5.xml:1.2 peardoc/en/package/html/html-quickform-advmultiselect/appendix/examples-custom5.xml:1.3
--- peardoc/en/package/html/html-quickform-advmultiselect/appendix/examples-custom5.xml:1.2 Wed Jan 28 22:25:14 2009
+++ peardoc/en/package/html/html-quickform-advmultiselect/appendix/examples-custom5.xml Thu Jan 29 21:17:15 2009
@@ -36,7 +36,7 @@
* Custom advMultiSelect HTML_QuickForm element
* that allows to manage sort of select boxes.
*
- * @version $Id: examples-custom5.xml,v 1.2 2009/01/28 22:25:14 farell Exp $
+ * @version $Id: examples-custom5.xml,v 1.3 2009/01/29 21:17:15 farell Exp $
* @author Laurent Laville <[email protected]>
* @package HTML_QuickForm_advmultiselect
* @subpackage Examples
@@ -53,6 +53,23 @@
$form = new HTML_QuickForm('amsCustom5');
$form->removeAttribute('name'); // XHTML compliance
+// same as default element template but wihtout the label (in first td cell)
+$withoutLabel = <<<_HTML
+<tr valign="top">
+ <td align="right">
+
+ </td>
+ <td align="left">
+ <!-- BEGIN error --><span style="color: #ff0000;">{error}</span><br /><!-- END error -->{element}
+ </td>
+</tr>
+_HTML;
+
+// more XHTML compliant
+// replace default element template with label, because submit button have no label
+$renderer =& $form->defaultRenderer();
+$renderer->setElementTemplate($withoutLabel, 'validate');
+
$fruit_array = array(
'apple' => 'Apple',
'orange' => 'Orange',
@@ -87,7 +104,7 @@
$form->addGroup($arrange, 'autoArrange', 'Sort list:');
$form->setDefaults(array('autoArrange' => 'N'));
-$validate =& $form->addElement('submit', null, 'Validate');
+$form->addElement('submit', 'validate', 'Validate');
$form->addElement('header', null, 'Advanced Multiple Select: custom layout ');
@@ -125,7 +142,7 @@
$buttons[] =& $form->createElement('submit', null, 'Submit');
$buttons[] =& $form->createElement('reset', null, 'Reset');
-$form->addGroup($buttons);
+$form->addGroup($buttons, null, ' ');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">