<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=HTML_QuickForm2</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/16807" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15618" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13088" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12065" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10617" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10193" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9922" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8626" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8318" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8060" />
      <rdf:li rdf:resource="http://pear.php.net/bug/7432" />
      <rdf:li rdf:resource="http://pear.php.net/bug/5957" />
      <rdf:li rdf:resource="http://pear.php.net/bug/5558" />
      <rdf:li rdf:resource="http://pear.php.net/bug/5308" />
      <rdf:li rdf:resource="http://pear.php.net/bug/4697" />
      <rdf:li rdf:resource="http://pear.php.net/bug/4268" />
      <rdf:li rdf:resource="http://pear.php.net/bug/4061" />
      <rdf:li rdf:resource="http://pear.php.net/bug/2535" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/16807">
      <title>HTML_QuickForm2: Feature/Change Request 16807 [Open] Input type 'file' should check for POST form</title>
      <link>http://pear.php.net/bugs/16807</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by addw
2009-11-19T19:30:09+00:00
PHP: 5.3.0 OS: any Package Version: 0.3.0

Description:
------------
If an addElement of type 'file' is done it should check that the form is a POST form - otherwise it won't work.
It should also complain if the encoding type is not multipart/form-data

Maybe people should know -- I suspect that many will get this wrong.</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by addw
2009-11-19T19:30:09+00:00
PHP: 5.3.0 OS: any Package Version: 0.3.0

Description:
------------
If an addElement of type 'file' is done it should check that the form is a POST form - otherwise it won't work.
It should also complain if the encoding type is not multipart/form-data

Maybe people should know -- I suspect that many will get this wrong.</pre>]]></description>
      <dc:date>2009-11-20T00:06:51+00:00</dc:date>
      <dc:creator>addw &amp;#x61;&amp;#116; phcomp &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15618">
      <title>HTML_QuickForm2: Feature/Change Request 15618 [Open] [patch] support arrayAccess interface</title>
      <link>http://pear.php.net/bugs/15618</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by cybot
2009-01-12T10:28:51+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
These patch implements arrayAccess Interface into HTML_QuickForm2_Container</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by cybot
2009-01-12T10:28:51+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
These patch implements arrayAccess Interface into HTML_QuickForm2_Container</pre>]]></description>
      <dc:date>2009-01-13T14:05:07+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; sebastianmendel &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13088">
      <title>HTML_QuickForm2: Bug 13088 [Open] using ajax i can't validate</title>
      <link>http://pear.php.net/bugs/13088</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Bug
Reported by vizzz
2008-02-08T06:15:40+00:00
PHP: 5.2.4 OS: Linux Package Version: 0.2.0

Description:
------------
I'm using ajax to fill options of a  &lt;select&gt; based on the event onchange of another &lt;select&gt;, when i submit the form i can't see in $form-&gt;getValue(); data from the ajax populated select.

Test script:
---------------
$fsText-&gt;addElement('text', 'txMatricola', array('style' =&gt; 'width: 300px;'), array('label' =&gt; 'Matricola:'));
$fsText-&gt;addElement('select', 'selProduttore', array('style' =&gt; 'width: 200px;','onchange' =&gt; 'makeRequest(\'getmodelsbyprod.php\', \'selModello-0\',this.value)'), array('options' =&gt; $data_prod, 'label' =&gt; 'Produttore:'));
$fsText-&gt;addElement('select', 'selModello', array('style' =&gt; 'width: 200px;'), array('label' =&gt; 'Modello:'));
$fsText-&gt;addElement('submit', 'btSubmit', array('value' =&gt; 'Invia'));
$fsText-&gt;addElement('hidden', 'hidValue');

Expected result:
----------------
i expect to see even an &quot;selModello&quot; entry in the array of results after validate.

Actual result:
--------------
array(5) { [&quot;_qf__matricola&quot;]=&gt;  string(0) &quot;&quot; [&quot;txMatricola&quot;]=&gt;  string(3) &quot;abc&quot; [&quot;selProduttore&quot;]=&gt;  string(1) &quot;2&quot; [&quot;btSubmit&quot;]=&gt;  string(5) &quot;Invia&quot; [&quot;hidValue&quot;]=&gt;  string(0) &quot;&quot; }</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Bug
Reported by vizzz
2008-02-08T06:15:40+00:00
PHP: 5.2.4 OS: Linux Package Version: 0.2.0

Description:
------------
I'm using ajax to fill options of a  &lt;select&gt; based on the event onchange of another &lt;select&gt;, when i submit the form i can't see in $form-&gt;getValue(); data from the ajax populated select.

Test script:
---------------
$fsText-&gt;addElement('text', 'txMatricola', array('style' =&gt; 'width: 300px;'), array('label' =&gt; 'Matricola:'));
$fsText-&gt;addElement('select', 'selProduttore', array('style' =&gt; 'width: 200px;','onchange' =&gt; 'makeRequest(\'getmodelsbyprod.php\', \'selModello-0\',this.value)'), array('options' =&gt; $data_prod, 'label' =&gt; 'Produttore:'));
$fsText-&gt;addElement('select', 'selModello', array('style' =&gt; 'width: 200px;'), array('label' =&gt; 'Modello:'));
$fsText-&gt;addElement('submit', 'btSubmit', array('value' =&gt; 'Invia'));
$fsText-&gt;addElement('hidden', 'hidValue');

Expected result:
----------------
i expect to see even an &quot;selModello&quot; entry in the array of results after validate.

Actual result:
--------------
array(5) { [&quot;_qf__matricola&quot;]=&gt;  string(0) &quot;&quot; [&quot;txMatricola&quot;]=&gt;  string(3) &quot;abc&quot; [&quot;selProduttore&quot;]=&gt;  string(1) &quot;2&quot; [&quot;btSubmit&quot;]=&gt;  string(5) &quot;Invia&quot; [&quot;hidValue&quot;]=&gt;  string(0) &quot;&quot; }</pre>]]></description>
      <dc:date>2008-02-09T09:48:41+00:00</dc:date>
      <dc:creator>a &amp;#x64;&amp;#111;&amp;#x74; visinoni &amp;#x61;&amp;#116; autron &amp;#x64;&amp;#111;&amp;#x74; it</dc:creator>
      <dc:subject>HTML_QuickForm2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12065">
      <title>HTML_QuickForm2: Bug 12065 [Open] Disabled (frozen) elements not accessible</title>
      <link>http://pear.php.net/bugs/12065</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Bug
Reported by nfreear
2007-09-17T07:39:12+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 0.1.0

Description:
------------
When a &quot;frozen&quot; (disabled) form element is displayed with QuickForm, it is not displayed as expected with a disabled=&quot;disabled&quot; attribute - instead QuickForm tries to give a plain text equivalent. This is a usability and accessibility problem:

1. It loses uniform appearance with the rest of the user interface, and will confuse some users.
2. For non-visual users using screen reader software this text may not be read and in any case will not make sense (More here, http://docs.moodle.org/en/Development:Accessibility_notes#Forms).

Applies to, at least: Input, InputCheckbox, InputPassword, InputRadio

HTML 4, disabled attribute,
http://www.w3.org/TR/html4/interact/forms.html#adef-disabled

We use QuickForm in Moodle - for the moment we have fixed it at our level, but really it needs fixing in the QuickForm2 base classes,
http://tracker.moodle.org/browse/MDL-8627

(Reported for HTML_QuickForm as Bug # 12063)

Expected result:
----------------
Checkbox example: &lt;label for=&quot;y&quot;&gt;label&lt;/label&gt; &lt;input type=&quot;checkbox&quot;
disabled=&quot;disabled&quot; id=&quot;y&quot; /&gt;

Actual result:
--------------
Checkbox example: label [ ], or [x]</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Bug
Reported by nfreear
2007-09-17T07:39:12+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 0.1.0

Description:
------------
When a &quot;frozen&quot; (disabled) form element is displayed with QuickForm, it is not displayed as expected with a disabled=&quot;disabled&quot; attribute - instead QuickForm tries to give a plain text equivalent. This is a usability and accessibility problem:

1. It loses uniform appearance with the rest of the user interface, and will confuse some users.
2. For non-visual users using screen reader software this text may not be read and in any case will not make sense (More here, http://docs.moodle.org/en/Development:Accessibility_notes#Forms).

Applies to, at least: Input, InputCheckbox, InputPassword, InputRadio

HTML 4, disabled attribute,
http://www.w3.org/TR/html4/interact/forms.html#adef-disabled

We use QuickForm in Moodle - for the moment we have fixed it at our level, but really it needs fixing in the QuickForm2 base classes,
http://tracker.moodle.org/browse/MDL-8627

(Reported for HTML_QuickForm as Bug # 12063)

Expected result:
----------------
Checkbox example: &lt;label for=&quot;y&quot;&gt;label&lt;/label&gt; &lt;input type=&quot;checkbox&quot;
disabled=&quot;disabled&quot; id=&quot;y&quot; /&gt;

Actual result:
--------------
Checkbox example: label [ ], or [x]</pre>]]></description>
      <dc:date>2007-09-17T07:39:12+00:00</dc:date>
      <dc:creator>n &amp;#x64;&amp;#111;&amp;#x74; d &amp;#x64;&amp;#111;&amp;#x74; freear &amp;#x61;&amp;#116; open &amp;#x64;&amp;#111;&amp;#x74; ac &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>HTML_QuickForm2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10617">
      <title>HTML_QuickForm2: Feature/Change Request 10617 [Open] Filter optional parameters</title>
      <link>http://pear.php.net/bugs/10617</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by buchanae
2007-04-04T17:44:46+00:00
PHP: 5.1.2 OS: Ubuntu Package Version: 

Description:
------------
Hello,

Apologies in advance if this is an inappropriate place to post this question.

The question relates to applying a filter to an element.  The syntax is

$form-&gt;applyFilter($element_name, $filter_callback);

My question is, what if the callback accepts parameters of some kind?  Is this worthy of a feature request?

Could it be as easy as adding an optional parameter to applyFilter and passing that to _recursiveFilter, then adding it to $value when you call_user_func?

Thanks in advance.

Cheers!
Alex</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by buchanae
2007-04-04T17:44:46+00:00
PHP: 5.1.2 OS: Ubuntu Package Version: 

Description:
------------
Hello,

Apologies in advance if this is an inappropriate place to post this question.

The question relates to applying a filter to an element.  The syntax is

$form-&gt;applyFilter($element_name, $filter_callback);

My question is, what if the callback accepts parameters of some kind?  Is this worthy of a feature request?

Could it be as easy as adding an optional parameter to applyFilter and passing that to _recursiveFilter, then adding it to $value when you call_user_func?

Thanks in advance.

Cheers!
Alex</pre>]]></description>
      <dc:date>2007-04-06T16:48:22+00:00</dc:date>
      <dc:creator>buchanae &amp;#x61;&amp;#116; osuosl &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10193">
      <title>HTML_QuickForm2: Feature/Change Request 10193 [Open] [patch] add addOptionalElement() to HTML_Quickform</title>
      <link>http://pear.php.net/bugs/10193</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by greg@...
2007-02-26T10:52:17+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
This may be a bit too specialized for Quickform, but I will submit the patch anyways in case someone has some interest. I also welcome feedback on the implementation.

Adds an addOptionalElement() function that adds an element which includes a checkbox next to it. If the checkbox is not selected, the element is disabled set to a 'standard value' (defined in the call to addOptionalElement()). If checked, the element becomes active and the user can set it to whatever they want. If a default value is passed via HTML_Quickform::setDefaults(), the checkbox is selected, and the default value is shown in the control. If a constant is specified with HTML_Quickform::setConstants(), the value of the control is set to the constant, and the checkbox is disabled.

The element can be any quickform element, and this requires patch 10191 (http://pear.php.net/bugs/10191).

Note that this does require prototype.js (http://www.prototypejs.org/) and prototypeUtils.js (http://jehiah.cz/archive/form-element-setvalue - for the JS function setValue()). Although it could probably be written in native JS, for my purposes prototype is fine, and I don't see much point putting in the effort and duplicating their code if this patch is in fact too specific to be added to HTML_Quickform anyways.

Original patch: http://freepbx.org/trac/changeset/3815

Test script:
---------------
Index: /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm/optionalgroup.php
===================================================================
--- /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm/optionalgroup.php (revision 3815)
+++ /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm/optionalgroup.php (revision 3815)
@@ -0,0 +1,199 @@
+&lt;?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+// +----------------------------------------------------------------------+
+// | PHP version 4.0                                                      |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Adam Daniel &lt;adaniel1@eesus.jnj.com&gt;                        |
+// |          Bertrand Mansion &lt;bmansion@mamasam.com&gt;                     |
+// +----------------------------------------------------------------------+
+//
+// $Id: group.php,v 1.38 2006/01/11 17:13:20 mansion Exp $
+
+require_once(&quot;HTML/QuickForm/group.php&quot;);
+
+/**
+ * HTML class for a form element group
+ * 
+ * @author       Adam Daniel &lt;adaniel1@eesus.jnj.com&gt;
+ * @author       Bertrand Mansion &lt;bmansion@mamasam.com&gt;
+ * @version      1.0
+ * @since        PHP4.04pl1
+ * @access       public
+ */
+class HTML_QuickForm_optionalgroup extends HTML_QuickForm_group
+{
+	var $_real_name;
+	var $_standard_value;
+	
+	var $_ele_standard = 0;
+	var $_ele_checkbox = 2;
+	var $_ele_control = 1;
+	
+    // {{{ constructor
+
+    /**
+     * Class constructor
+     * 
+     * @param     mixed     $standardValue  (optional)The value to use if the user doesn't specify a value.
+	 *                                      If an array is passed, uses $standardValue[$elementName] if found.
+     * @param     string    $elementName    (optional)The name of the element
+     * @param     array     $elementLabel   (optional)The label to use
+     * @param     array     $elementObject  (optional)The element to use as the main control
+     * @since     1.0
+     * @access    public
+     * @return    void
+     */
+    function HTML_QuickForm_optionalgroup($standardValue=null, $elementName=null, $elementLabel=null, $elementObject=null)
+    {   
+        if (is_null($elementObject)) {
+			return;
+		}
+		
+		if (is_array($standardValue) &amp;&amp; isset($standardValue[$elementName])) {
+			$this-&gt;_standard_value = $standardValue[$elementName];
+		} else {
+			$this-&gt;_standard_value = $standardValue;
+		}
+		
+		$elementObject-&gt;_generateId();
+        $id = $elementObject-&gt;getAttribute('id');
+		
+		$this-&gt;_real_name = $elementObject-&gt;getName();
+		
+        $elements = array();
+		// hidden element to store default value
+        $elements[$this-&gt;_ele_standard] =&amp; HTML_QuickForm::createElement('hidden', 'qf_default_'.$elementName, null); 
+		$elements[$this-&gt;_ele_standard]-&gt;_generateId();
+		$hidden_id = $elements[$this-&gt;_ele_standard]-&gt;getAttribute('id');
+		
+		// checkbox element, to select that real element is editable
+        /*
+		$checkattrs = array(
+            'onclick' =&gt; //javascript
+                'if (this.checked) { '.
+                '   document.getElementById(\''.$id.'\').disabled = false; '.
+                '   document.getElementById(\''.$id.'\').class = \'disabled\'; '.
+                '} else { '.
+                '   document.getElementById(\''.$id.'\').disabled = true; '.
+                '   document.getElementById(\''.$id.'\').class = \'\'; '.
+                '   document.getElementById(\''.$id.'\').value = document.getElementById(\''.$hidden_id.'\').value;'.
+                '   document.getElementById(\''.$id.'\').focus();'.
+                '}',
+        );
+		*/
+		$checkattrs = array(
+            'onclick' =&gt; //javascript
+                'if (this.checked) { '.
+                '   $(\''.$id.'\').enable();'.
+                '   $(\''.$id.'\').class = \'disabled\'; '.
+                '} else { '.
+                '   $(\''.$id.'\').disable();'.
+                '   $(\''.$id.'\').class = \'\'; '.
+                '   Form.Element.setValue(\''.$id.'\', $(\''.$hidden_id.'\').getValue() );'.
+                '   $(\''.$id.'\').activate();'.
+                '}  alert($(\''.$id.'\').class);',
+			'title' =&gt; 'Enable/disable this control',
+			'class' =&gt; 'enablercheck',
+        );
+		
+		
+		$elements[$this-&gt;_ele_checkbox] =&amp; HTML_QuickForm::createElement('checkbox', 'qf_checkbox_'.$elementName, null, null, $checkattrs);
+		
+		// real control element
+		$elements[$this-&gt;_ele_control] =&amp; $elementObject;
+        
+		ksort($elements);
+		
+		//'qf_optionalgroup_'.$elementName
+        parent::HTML_QuickForm_group($elementName, $elementLabel, $elements, '&amp;nbsp;', true);
+    } //end constructor
+    
+    // }}}
+
+    // {{{ onQuickFormEvent()
+
+    /**
+     * Called by HTML_QuickForm whenever form event is made on this element
+     *
+     * @param     string    $event  Name of event
+     * @param     mixed     $arg    event arguments
+     * @param     object    $caller calling object
+     * @since     1.0
+     * @access    public
+     * @return    void
+     */
+    function onQuickFormEvent($event, $arg, &amp;$caller)
+    {
+        switch ($event) {
+            case 'updateValue':
+                $this-&gt;_createElementsIfNotExist();
+                // elements[0] is hidden default element
+				// elements[1] is checkbox,
+                // elements[2] is actual control
+				
+                // constant values override both default and submitted ones
+                // default values are overriden by submitted
+                if (isset($caller-&gt;_constantValues[$this-&gt;getName()])) {
+                    // constant in use, so this is always checked, and textbox is always disabled
+	                $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(false);
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setDisabled(true);
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;addClass('disabled');
+                    
+                    $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(true);
+                    $this-&gt;_elements[$this-&gt;_ele_control]-&gt;addClass('disabled');
+                    $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($caller-&gt;_constantValues[$this-&gt;getName()]);
+                } else {
+					// checkbox control is enabled
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setDisabled(false);
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;removeClass('disabled');
+                    
+                    // get the 'standard' value
+                    $default = isset($caller-&gt;_defaultValues[$this-&gt;getName()]) ? $caller-&gt;_defaultValues[$this-&gt;getName()] : null;
+                    
+					// save default value to the form
+					//TODO $this-&gt;_elements[0]-&gt;setValue($default);
+					$this-&gt;_elements[0]-&gt;setValue($this-&gt;_standard_value);
+					
+                    if ($caller-&gt;isSubmitted() &amp;&amp; isset($caller-&gt;_submitValues[$this-&gt;getName()]) 
+                      &amp;&amp; $caller-&gt;_submitValues[$this-&gt;getName()] != $this-&gt;_standard_value) {
+                        // submitted, not using &quot;standard&quot;
+                        $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(true);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(false);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;removeClass('disabled');
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($caller-&gt;_submitValues[$this-&gt;getName()]);
+                    } else if ($default) {
+						// not submitted, and a default is set
+						$this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(true);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(false);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;removeClass('disabled');
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($default);
+					} else {
+                        // not submitted, or value is = standard value
+                        $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(false);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(true);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;addClass('disabled');
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($this-&gt;_standard_value);
+                    }
+                }
+
+                break;
+
+            default:
+                parent::onQuickFormEvent($event, $arg, $caller);
+        }
+        return true;
+    } // end func onQuickFormEvent
+
+    // }}}
+
+}
Index: /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm.php
===================================================================
--- /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm.php (revision 3661)
+++ /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm.php (revision 3815)
@@ -49,4 +49,5 @@
             'xbutton'       =&gt;array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton'),
             'advmultiselect'=&gt;array('HTML/QuickForm/advmultiselect.php','HTML_QuickForm_advmultiselect'),
+            'optionalgroup' =&gt;array('HTML/QuickForm/optionalgroup.php','HTML_QuickForm_optionalgroup'),
         );
 
@@ -727,4 +728,40 @@
         return $group;
     } // end func addGroup
+    
+    // }}}
+	// {{{ addOptionalElement()
+
+    /**
+     * Adds an optional element, using a checkbox
+     * @param    array      $elements       array of elements composing the group
+     * @param    string     $name           (optional)group name
+     * @param    string     $groupLabel     (optional)group label
+     * @param    string     $separator      (optional)string to separate elements
+     * @param    string     $appendName     (optional)specify whether the group name should be
+     *                                      used in the form element name ex: group[element]
+     * @return   object     reference to added group of elements
+     * @since    2.8
+     * @access   public
+     * @throws   PEAR_Error
+     */
+    function &amp;addOptionalElement($element, $name, $standardValue, $groupLabel /*, optional multiple params.. */)
+    {
+        if (is_object($element) &amp;&amp; is_subclass_of($element, 'html_quickform_element')) {
+           $elementObject = &amp;$element;
+        } else {
+			// get arguments for elementObject
+            $args = array_slice(func_get_args(),3); 
+			array_unshift($args, null); // stick null on the beginning (element name)
+			
+			$elementObject =&amp; $this-&gt;_loadElement('addElement', $element, $args);
+            if (PEAR::isError($elementObject)) {
+                return $elementObject;
+            }
+        }
+        
+		$group =&amp; $this-&gt;addElement('optionalgroup', $standardValue, $name, $groupLabel, $elementObject);
+        return $group;
+		
+    } // end func addOptionalElement
     
     // }}}</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by greg@...
2007-02-26T10:52:17+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
This may be a bit too specialized for Quickform, but I will submit the patch anyways in case someone has some interest. I also welcome feedback on the implementation.

Adds an addOptionalElement() function that adds an element which includes a checkbox next to it. If the checkbox is not selected, the element is disabled set to a 'standard value' (defined in the call to addOptionalElement()). If checked, the element becomes active and the user can set it to whatever they want. If a default value is passed via HTML_Quickform::setDefaults(), the checkbox is selected, and the default value is shown in the control. If a constant is specified with HTML_Quickform::setConstants(), the value of the control is set to the constant, and the checkbox is disabled.

The element can be any quickform element, and this requires patch 10191 (http://pear.php.net/bugs/10191).

Note that this does require prototype.js (http://www.prototypejs.org/) and prototypeUtils.js (http://jehiah.cz/archive/form-element-setvalue - for the JS function setValue()). Although it could probably be written in native JS, for my purposes prototype is fine, and I don't see much point putting in the effort and duplicating their code if this patch is in fact too specific to be added to HTML_Quickform anyways.

Original patch: http://freepbx.org/trac/changeset/3815

Test script:
---------------
Index: /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm/optionalgroup.php
===================================================================
--- /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm/optionalgroup.php (revision 3815)
+++ /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm/optionalgroup.php (revision 3815)
@@ -0,0 +1,199 @@
+&lt;?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+// +----------------------------------------------------------------------+
+// | PHP version 4.0                                                      |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Adam Daniel &lt;adaniel1@eesus.jnj.com&gt;                        |
+// |          Bertrand Mansion &lt;bmansion@mamasam.com&gt;                     |
+// +----------------------------------------------------------------------+
+//
+// $Id: group.php,v 1.38 2006/01/11 17:13:20 mansion Exp $
+
+require_once(&quot;HTML/QuickForm/group.php&quot;);
+
+/**
+ * HTML class for a form element group
+ * 
+ * @author       Adam Daniel &lt;adaniel1@eesus.jnj.com&gt;
+ * @author       Bertrand Mansion &lt;bmansion@mamasam.com&gt;
+ * @version      1.0
+ * @since        PHP4.04pl1
+ * @access       public
+ */
+class HTML_QuickForm_optionalgroup extends HTML_QuickForm_group
+{
+	var $_real_name;
+	var $_standard_value;
+	
+	var $_ele_standard = 0;
+	var $_ele_checkbox = 2;
+	var $_ele_control = 1;
+	
+    // {{{ constructor
+
+    /**
+     * Class constructor
+     * 
+     * @param     mixed     $standardValue  (optional)The value to use if the user doesn't specify a value.
+	 *                                      If an array is passed, uses $standardValue[$elementName] if found.
+     * @param     string    $elementName    (optional)The name of the element
+     * @param     array     $elementLabel   (optional)The label to use
+     * @param     array     $elementObject  (optional)The element to use as the main control
+     * @since     1.0
+     * @access    public
+     * @return    void
+     */
+    function HTML_QuickForm_optionalgroup($standardValue=null, $elementName=null, $elementLabel=null, $elementObject=null)
+    {   
+        if (is_null($elementObject)) {
+			return;
+		}
+		
+		if (is_array($standardValue) &amp;&amp; isset($standardValue[$elementName])) {
+			$this-&gt;_standard_value = $standardValue[$elementName];
+		} else {
+			$this-&gt;_standard_value = $standardValue;
+		}
+		
+		$elementObject-&gt;_generateId();
+        $id = $elementObject-&gt;getAttribute('id');
+		
+		$this-&gt;_real_name = $elementObject-&gt;getName();
+		
+        $elements = array();
+		// hidden element to store default value
+        $elements[$this-&gt;_ele_standard] =&amp; HTML_QuickForm::createElement('hidden', 'qf_default_'.$elementName, null); 
+		$elements[$this-&gt;_ele_standard]-&gt;_generateId();
+		$hidden_id = $elements[$this-&gt;_ele_standard]-&gt;getAttribute('id');
+		
+		// checkbox element, to select that real element is editable
+        /*
+		$checkattrs = array(
+            'onclick' =&gt; //javascript
+                'if (this.checked) { '.
+                '   document.getElementById(\''.$id.'\').disabled = false; '.
+                '   document.getElementById(\''.$id.'\').class = \'disabled\'; '.
+                '} else { '.
+                '   document.getElementById(\''.$id.'\').disabled = true; '.
+                '   document.getElementById(\''.$id.'\').class = \'\'; '.
+                '   document.getElementById(\''.$id.'\').value = document.getElementById(\''.$hidden_id.'\').value;'.
+                '   document.getElementById(\''.$id.'\').focus();'.
+                '}',
+        );
+		*/
+		$checkattrs = array(
+            'onclick' =&gt; //javascript
+                'if (this.checked) { '.
+                '   $(\''.$id.'\').enable();'.
+                '   $(\''.$id.'\').class = \'disabled\'; '.
+                '} else { '.
+                '   $(\''.$id.'\').disable();'.
+                '   $(\''.$id.'\').class = \'\'; '.
+                '   Form.Element.setValue(\''.$id.'\', $(\''.$hidden_id.'\').getValue() );'.
+                '   $(\''.$id.'\').activate();'.
+                '}  alert($(\''.$id.'\').class);',
+			'title' =&gt; 'Enable/disable this control',
+			'class' =&gt; 'enablercheck',
+        );
+		
+		
+		$elements[$this-&gt;_ele_checkbox] =&amp; HTML_QuickForm::createElement('checkbox', 'qf_checkbox_'.$elementName, null, null, $checkattrs);
+		
+		// real control element
+		$elements[$this-&gt;_ele_control] =&amp; $elementObject;
+        
+		ksort($elements);
+		
+		//'qf_optionalgroup_'.$elementName
+        parent::HTML_QuickForm_group($elementName, $elementLabel, $elements, '&amp;nbsp;', true);
+    } //end constructor
+    
+    // }}}
+
+    // {{{ onQuickFormEvent()
+
+    /**
+     * Called by HTML_QuickForm whenever form event is made on this element
+     *
+     * @param     string    $event  Name of event
+     * @param     mixed     $arg    event arguments
+     * @param     object    $caller calling object
+     * @since     1.0
+     * @access    public
+     * @return    void
+     */
+    function onQuickFormEvent($event, $arg, &amp;$caller)
+    {
+        switch ($event) {
+            case 'updateValue':
+                $this-&gt;_createElementsIfNotExist();
+                // elements[0] is hidden default element
+				// elements[1] is checkbox,
+                // elements[2] is actual control
+				
+                // constant values override both default and submitted ones
+                // default values are overriden by submitted
+                if (isset($caller-&gt;_constantValues[$this-&gt;getName()])) {
+                    // constant in use, so this is always checked, and textbox is always disabled
+	                $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(false);
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setDisabled(true);
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;addClass('disabled');
+                    
+                    $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(true);
+                    $this-&gt;_elements[$this-&gt;_ele_control]-&gt;addClass('disabled');
+                    $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($caller-&gt;_constantValues[$this-&gt;getName()]);
+                } else {
+					// checkbox control is enabled
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setDisabled(false);
+                    $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;removeClass('disabled');
+                    
+                    // get the 'standard' value
+                    $default = isset($caller-&gt;_defaultValues[$this-&gt;getName()]) ? $caller-&gt;_defaultValues[$this-&gt;getName()] : null;
+                    
+					// save default value to the form
+					//TODO $this-&gt;_elements[0]-&gt;setValue($default);
+					$this-&gt;_elements[0]-&gt;setValue($this-&gt;_standard_value);
+					
+                    if ($caller-&gt;isSubmitted() &amp;&amp; isset($caller-&gt;_submitValues[$this-&gt;getName()]) 
+                      &amp;&amp; $caller-&gt;_submitValues[$this-&gt;getName()] != $this-&gt;_standard_value) {
+                        // submitted, not using &quot;standard&quot;
+                        $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(true);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(false);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;removeClass('disabled');
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($caller-&gt;_submitValues[$this-&gt;getName()]);
+                    } else if ($default) {
+						// not submitted, and a default is set
+						$this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(true);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(false);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;removeClass('disabled');
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($default);
+					} else {
+                        // not submitted, or value is = standard value
+                        $this-&gt;_elements[$this-&gt;_ele_checkbox]-&gt;setChecked(false);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setDisabled(true);
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;addClass('disabled');
+                        $this-&gt;_elements[$this-&gt;_ele_control]-&gt;setValue($this-&gt;_standard_value);
+                    }
+                }
+
+                break;
+
+            default:
+                parent::onQuickFormEvent($event, $arg, $caller);
+        }
+        return true;
+    } // end func onQuickFormEvent
+
+    // }}}
+
+}
Index: /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm.php
===================================================================
--- /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm.php (revision 3661)
+++ /freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm.php (revision 3815)
@@ -49,4 +49,5 @@
             'xbutton'       =&gt;array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton'),
             'advmultiselect'=&gt;array('HTML/QuickForm/advmultiselect.php','HTML_QuickForm_advmultiselect'),
+            'optionalgroup' =&gt;array('HTML/QuickForm/optionalgroup.php','HTML_QuickForm_optionalgroup'),
         );
 
@@ -727,4 +728,40 @@
         return $group;
     } // end func addGroup
+    
+    // }}}
+	// {{{ addOptionalElement()
+
+    /**
+     * Adds an optional element, using a checkbox
+     * @param    array      $elements       array of elements composing the group
+     * @param    string     $name           (optional)group name
+     * @param    string     $groupLabel     (optional)group label
+     * @param    string     $separator      (optional)string to separate elements
+     * @param    string     $appendName     (optional)specify whether the group name should be
+     *                                      used in the form element name ex: group[element]
+     * @return   object     reference to added group of elements
+     * @since    2.8
+     * @access   public
+     * @throws   PEAR_Error
+     */
+    function &amp;addOptionalElement($element, $name, $standardValue, $groupLabel /*, optional multiple params.. */)
+    {
+        if (is_object($element) &amp;&amp; is_subclass_of($element, 'html_quickform_element')) {
+           $elementObject = &amp;$element;
+        } else {
+			// get arguments for elementObject
+            $args = array_slice(func_get_args(),3); 
+			array_unshift($args, null); // stick null on the beginning (element name)
+			
+			$elementObject =&amp; $this-&gt;_loadElement('addElement', $element, $args);
+            if (PEAR::isError($elementObject)) {
+                return $elementObject;
+            }
+        }
+        
+		$group =&amp; $this-&gt;addElement('optionalgroup', $standardValue, $name, $groupLabel, $elementObject);
+        return $group;
+		
+    } // end func addOptionalElement
     
     // }}}</pre>]]></description>
      <dc:date>2007-03-07T12:26:17+00:00</dc:date>
      <dc:creator>greg &amp;#x61;&amp;#116; mtechsolutions &amp;#x64;&amp;#111;&amp;#x74; ca</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9922">
      <title>HTML_QuickForm2: Feature/Change Request 9922 [Open] YUI Autocomplete form element type</title>
      <link>http://pear.php.net/bugs/9922</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by benjaminhill@...
2007-01-22T21:08:18+00:00
PHP: 5.1.0 OS: WinXP Package Version: CVS

Description:
------------
It would be very slick to have a subclass of the &quot;input&quot; form element type that supported the YUI AutoComplete library.
(Which is, I believe, BSD, so it should be ok?)

http://developer.yahoo.com/yui/autocomplete/</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by benjaminhill@...
2007-01-22T21:08:18+00:00
PHP: 5.1.0 OS: WinXP Package Version: CVS

Description:
------------
It would be very slick to have a subclass of the &quot;input&quot; form element type that supported the YUI AutoComplete library.
(Which is, I believe, BSD, so it should be ok?)

http://developer.yahoo.com/yui/autocomplete/</pre>]]></description>
      <dc:date>2007-01-22T21:08:18+00:00</dc:date>
      <dc:creator>benjaminhill &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8626">
      <title>HTML_QuickForm2: Feature/Change Request 8626 [Open] new subtype: ximage for &lt;img ....&gt;</title>
      <link>http://pear.php.net/bugs/8626</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by b_j@...
2006-09-03T14:16:12+00:00
PHP: Irrelevant OS:  Package Version: 3.2.6

Description:
------------
HTML/QuickForm/ximage.php:
&lt;?php
require_once 'HTML/QuickForm/element.php';
class HTML_QuickForm_ximage extends HTML_QuickForm_element
{
		function HTML_QuickForm_ximage($elementName = null, $src='', $attributes = null){
			$this-&gt;HTML_QuickForm_element($elementName, null, $attributes);
			$this-&gt;setSource($src);
			$this-&gt;setType('ximage');
		}
		function setType($type){
			$this-&gt;_type = $type;
			//$this-&gt;updateAttributes(array('type'=&gt;$type));
		} // end func setType
		function setSource($src){
				$this-&gt;updateAttributes(array('src' =&gt; $src));
		} // end func setSource
		function setBorder($border){
				$this-&gt;updateAttributes(array('border' =&gt; $border));
		} // end func setBorder
		function setAlign($align){
				$this-&gt;updateAttributes(array('align' =&gt; $align));
		} // end func setAlign
		function setHeight($height){
			$this-&gt;updateAttributes(array('height' =&gt; $height));
		}
		function setWidth($width){
			$this-&gt;updateAttributes(array('width' =&gt; $width));
		}
		function freeze(){
			return false;
		} //end func freeze
		function toHtml(){
			$this-&gt;setType(null);
			return '&lt;IMG' . $this-&gt;getAttributes(true) . ' /&gt;';
		}
		function getFrozenHtml(){
			return $this-&gt;toHtml();
		}
		function setName($name){
			$this-&gt;updateAttributes(array('name' =&gt; $name));
		}
		function getName(){
			return $this-&gt;getAttribute('name');
		}


}
?&gt;
HTML/QuickForm.php:
....
//Hungarian translation:
	var $_jsPrefix = 'Rossz adat';
	var $_jsPostfix = 'JavÃ­tani kell ezt az adatot';
	var $_requiredNote = '&lt;span style=&quot;font-size:80%; color:#ff0000;&quot;&gt;*&lt;/span&gt;'.
		'&lt;span style=&quot;font-size:80%;&quot;&gt; KÃ¶telezÃµ mezÃµ&lt;/span&gt;';
....
$GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'] = 
				array(
						'group'         =&gt;array('HTML/QuickForm/group.php','HTML_QuickForm_group'),
						'hidden'        =&gt;array('HTML/QuickForm/hidden.php','HTML_QuickForm_hidden'),
						'reset'         =&gt;array('HTML/QuickForm/reset.php','HTML_QuickForm_reset'),
						'checkbox'      =&gt;array('HTML/QuickForm/checkbox.php','HTML_QuickForm_checkbox'),
						'file'          =&gt;array('HTML/QuickForm/file.php','HTML_QuickForm_file'),
            'image'         =&gt;array('HTML/QuickForm/image.php','HTML_QuickForm_image'),
						'password'      =&gt;array('HTML/QuickForm/password.php','HTML_QuickForm_password'),
						'radio'         =&gt;array('HTML/QuickForm/radio.php','HTML_QuickForm_radio'),
						'button'        =&gt;array('HTML/QuickForm/button.php','HTML_QuickForm_button'),
						'submit'        =&gt;array('HTML/QuickForm/submit.php','HTML_QuickForm_submit'),
						'select'        =&gt;array('HTML/QuickForm/select.php','HTML_QuickForm_select'),
						'hiddenselect'  =&gt;array('HTML/QuickForm/hiddenselect.php','HTML_QuickForm_hiddenselect'),
						'text'          =&gt;array('HTML/QuickForm/text.php','HTML_QuickForm_text'),
						'textarea'      =&gt;array('HTML/QuickForm/textarea.php','HTML_QuickForm_textarea'),
						'link'          =&gt;array('HTML/QuickForm/link.php','HTML_QuickForm_link'),
						'advcheckbox'   =&gt;array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox'),
						'date'          =&gt;array('HTML/QuickForm/date.php','HTML_QuickForm_date'),
						'static'        =&gt;array('HTML/QuickForm/static.php','HTML_QuickForm_static'),
						'header'        =&gt;array('HTML/QuickForm/header.php', 'HTML_QuickForm_header'),
						'html'          =&gt;array('HTML/QuickForm/html.php', 'HTML_QuickForm_html'),
						'hierselect'    =&gt;array('HTML/QuickForm/hierselect.php', 'HTML_QuickForm_hierselect'),
						'autocomplete'  =&gt;array('HTML/QuickForm/autocomplete.php', 'HTML_QuickForm_autocomplete'),
						'xbutton'       =&gt;array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton'),
						//BJ
						'ximage'        =&gt;array('HTML/QuickForm/ximage.php','HTML_QuickForm_ximage')
				);
....</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by b_j@...
2006-09-03T14:16:12+00:00
PHP: Irrelevant OS:  Package Version: 3.2.6

Description:
------------
HTML/QuickForm/ximage.php:
&lt;?php
require_once 'HTML/QuickForm/element.php';
class HTML_QuickForm_ximage extends HTML_QuickForm_element
{
		function HTML_QuickForm_ximage($elementName = null, $src='', $attributes = null){
			$this-&gt;HTML_QuickForm_element($elementName, null, $attributes);
			$this-&gt;setSource($src);
			$this-&gt;setType('ximage');
		}
		function setType($type){
			$this-&gt;_type = $type;
			//$this-&gt;updateAttributes(array('type'=&gt;$type));
		} // end func setType
		function setSource($src){
				$this-&gt;updateAttributes(array('src' =&gt; $src));
		} // end func setSource
		function setBorder($border){
				$this-&gt;updateAttributes(array('border' =&gt; $border));
		} // end func setBorder
		function setAlign($align){
				$this-&gt;updateAttributes(array('align' =&gt; $align));
		} // end func setAlign
		function setHeight($height){
			$this-&gt;updateAttributes(array('height' =&gt; $height));
		}
		function setWidth($width){
			$this-&gt;updateAttributes(array('width' =&gt; $width));
		}
		function freeze(){
			return false;
		} //end func freeze
		function toHtml(){
			$this-&gt;setType(null);
			return '&lt;IMG' . $this-&gt;getAttributes(true) . ' /&gt;';
		}
		function getFrozenHtml(){
			return $this-&gt;toHtml();
		}
		function setName($name){
			$this-&gt;updateAttributes(array('name' =&gt; $name));
		}
		function getName(){
			return $this-&gt;getAttribute('name');
		}


}
?&gt;
HTML/QuickForm.php:
....
//Hungarian translation:
	var $_jsPrefix = 'Rossz adat';
	var $_jsPostfix = 'JavÃ­tani kell ezt az adatot';
	var $_requiredNote = '&lt;span style=&quot;font-size:80%; color:#ff0000;&quot;&gt;*&lt;/span&gt;'.
		'&lt;span style=&quot;font-size:80%;&quot;&gt; KÃ¶telezÃµ mezÃµ&lt;/span&gt;';
....
$GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'] = 
				array(
						'group'         =&gt;array('HTML/QuickForm/group.php','HTML_QuickForm_group'),
						'hidden'        =&gt;array('HTML/QuickForm/hidden.php','HTML_QuickForm_hidden'),
						'reset'         =&gt;array('HTML/QuickForm/reset.php','HTML_QuickForm_reset'),
						'checkbox'      =&gt;array('HTML/QuickForm/checkbox.php','HTML_QuickForm_checkbox'),
						'file'          =&gt;array('HTML/QuickForm/file.php','HTML_QuickForm_file'),
            'image'         =&gt;array('HTML/QuickForm/image.php','HTML_QuickForm_image'),
						'password'      =&gt;array('HTML/QuickForm/password.php','HTML_QuickForm_password'),
						'radio'         =&gt;array('HTML/QuickForm/radio.php','HTML_QuickForm_radio'),
						'button'        =&gt;array('HTML/QuickForm/button.php','HTML_QuickForm_button'),
						'submit'        =&gt;array('HTML/QuickForm/submit.php','HTML_QuickForm_submit'),
						'select'        =&gt;array('HTML/QuickForm/select.php','HTML_QuickForm_select'),
						'hiddenselect'  =&gt;array('HTML/QuickForm/hiddenselect.php','HTML_QuickForm_hiddenselect'),
						'text'          =&gt;array('HTML/QuickForm/text.php','HTML_QuickForm_text'),
						'textarea'      =&gt;array('HTML/QuickForm/textarea.php','HTML_QuickForm_textarea'),
						'link'          =&gt;array('HTML/QuickForm/link.php','HTML_QuickForm_link'),
						'advcheckbox'   =&gt;array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox'),
						'date'          =&gt;array('HTML/QuickForm/date.php','HTML_QuickForm_date'),
						'static'        =&gt;array('HTML/QuickForm/static.php','HTML_QuickForm_static'),
						'header'        =&gt;array('HTML/QuickForm/header.php', 'HTML_QuickForm_header'),
						'html'          =&gt;array('HTML/QuickForm/html.php', 'HTML_QuickForm_html'),
						'hierselect'    =&gt;array('HTML/QuickForm/hierselect.php', 'HTML_QuickForm_hierselect'),
						'autocomplete'  =&gt;array('HTML/QuickForm/autocomplete.php', 'HTML_QuickForm_autocomplete'),
						'xbutton'       =&gt;array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton'),
						//BJ
						'ximage'        =&gt;array('HTML/QuickForm/ximage.php','HTML_QuickForm_ximage')
				);
....</pre>]]></description>
      <dc:date>2006-09-04T11:22:13+00:00</dc:date>
      <dc:creator>b_j &amp;#x61;&amp;#116; tar &amp;#x64;&amp;#111;&amp;#x74; hu</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8318">
      <title>HTML_QuickForm2: Feature/Change Request 8318 [Open] new feature using validate_ptBR</title>
      <link>http://pear.php.net/bugs/8318</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by jesus@...
2006-07-28T15:22:12+00:00
PHP: 4.4.2 OS: Linux - Suse Package Version: 3.2.6

Description:
------------
i created a validation class for quick_form
The class extends &quot;HTML_QuickForm_Rule&quot; the same of Email, Range, Regex...
&quot;phone number&quot; function is not implemented

Test script:
---------------
http://www.fo.ufu.br/Jesus/Testes/testes_brazilian/Brazilian.php
http://www.fo.ufu.br/Jesus/Testes/testes_brazilian/Brazilian2.php
http://www.fo.ufu.br/Jesus/Testes/testes_brazilian/form_validate.php

Expected result:
----------------
the same of validation_ptBR

Actual result:
--------------
the same of validation_ptBR
only &quot;phone number&quot; not</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by jesus@...
2006-07-28T15:22:12+00:00
PHP: 4.4.2 OS: Linux - Suse Package Version: 3.2.6

Description:
------------
i created a validation class for quick_form
The class extends &quot;HTML_QuickForm_Rule&quot; the same of Email, Range, Regex...
&quot;phone number&quot; function is not implemented

Test script:
---------------
http://www.fo.ufu.br/Jesus/Testes/testes_brazilian/Brazilian.php
http://www.fo.ufu.br/Jesus/Testes/testes_brazilian/Brazilian2.php
http://www.fo.ufu.br/Jesus/Testes/testes_brazilian/form_validate.php

Expected result:
----------------
the same of validation_ptBR

Actual result:
--------------
the same of validation_ptBR
only &quot;phone number&quot; not</pre>]]></description>
      <dc:date>2006-09-04T11:23:20+00:00</dc:date>
      <dc:creator>jesus &amp;#x61;&amp;#116; evasta &amp;#x64;&amp;#111;&amp;#x74; com &amp;#x64;&amp;#111;&amp;#x74; br</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8060">
      <title>HTML_QuickForm2: Feature/Change Request 8060 [Open] HTML_QuickForm_select -&gt; loadDbResult Support MDB2</title>
      <link>http://pear.php.net/bugs/8060</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by dvilches@...
2006-06-28T11:47:54+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 3.2.6

Description:
------------
I changed the method loadDbResult in HTML_QuickForm_select.

Test script:
---------------
require_once 'MDB2.php';
$dsn = array('phptype'  =&gt; DB_PHPTYPE,
	     'username' =&gt; DB_USER,
	     'password' =&gt; DB_PWD,
	     'hostspec' =&gt; DB_HOST,
	     'database' =&gt; DB_DATABASE,
					); 
$db = MDB2::factory($dsn); 
if (Pear::isError($db)){
    die($db-&gt;getMessage());
}
$db-&gt;setFetchMode(MDB2_FETCHMODE_ASSOC);

$sql  = &quot;Select table_id, descrip From table&quot;;
$element = &amp;HTML_QuickForm::createElement('select', 'table_id', 'Descrip');
$result = $db-&gt;query($sql);	
$element-&gt;addOption('','');
$element-&gt;loadDbResult($result, 'descrip', 'table_id');		$element-&gt;toHtml();	


The change of this method is:

if (!is_object($result) || !is_a($result, 'db_result')) {
....

by

if (!is_object($result) || (!is_a($result, 'db_result') &amp;&amp; !is_a($result, 'mdb2_result'))) {
...

And works for me...


Expected result:
----------------
&lt;select name=&quot;table_id&quot;&gt;
  &lt;option value=&quot;&quot;&gt;&lt;/option&gt;
  &lt;option value=&quot;1&quot; selected=&quot;selected&quot;&gt;Descrip 1&lt;/option&gt;
  &lt;option value=&quot;2&quot;&gt;Descrip 2&lt;/option&gt;
  &lt;option value=&quot;3&quot;&gt;Descrip 3&lt;/option&gt;
&lt;/select&gt;

Actual result:
--------------
&lt;select name=&quot;table_id&quot;&gt;
  &lt;option value=&quot;&quot;&gt;&lt;/option&gt;
&lt;/select&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by dvilches@...
2006-06-28T11:47:54+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 3.2.6

Description:
------------
I changed the method loadDbResult in HTML_QuickForm_select.

Test script:
---------------
require_once 'MDB2.php';
$dsn = array('phptype'  =&gt; DB_PHPTYPE,
	     'username' =&gt; DB_USER,
	     'password' =&gt; DB_PWD,
	     'hostspec' =&gt; DB_HOST,
	     'database' =&gt; DB_DATABASE,
					); 
$db = MDB2::factory($dsn); 
if (Pear::isError($db)){
    die($db-&gt;getMessage());
}
$db-&gt;setFetchMode(MDB2_FETCHMODE_ASSOC);

$sql  = &quot;Select table_id, descrip From table&quot;;
$element = &amp;HTML_QuickForm::createElement('select', 'table_id', 'Descrip');
$result = $db-&gt;query($sql);	
$element-&gt;addOption('','');
$element-&gt;loadDbResult($result, 'descrip', 'table_id');		$element-&gt;toHtml();	


The change of this method is:

if (!is_object($result) || !is_a($result, 'db_result')) {
....

by

if (!is_object($result) || (!is_a($result, 'db_result') &amp;&amp; !is_a($result, 'mdb2_result'))) {
...

And works for me...


Expected result:
----------------
&lt;select name=&quot;table_id&quot;&gt;
  &lt;option value=&quot;&quot;&gt;&lt;/option&gt;
  &lt;option value=&quot;1&quot; selected=&quot;selected&quot;&gt;Descrip 1&lt;/option&gt;
  &lt;option value=&quot;2&quot;&gt;Descrip 2&lt;/option&gt;
  &lt;option value=&quot;3&quot;&gt;Descrip 3&lt;/option&gt;
&lt;/select&gt;

Actual result:
--------------
&lt;select name=&quot;table_id&quot;&gt;
  &lt;option value=&quot;&quot;&gt;&lt;/option&gt;
&lt;/select&gt;</pre>]]></description>
      <dc:date>2006-10-06T10:45:36+00:00</dc:date>
      <dc:creator>dvilches &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/7432">
      <title>HTML_QuickForm2: Feature/Change Request 7432 [Analyzed] Client side validation</title>
      <link>http://pear.php.net/bugs/7432</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by gdalle@...
2006-04-20T03:27:14+00:00
PHP: 4.3.10 OS: Win Xp Package Version: 3.2.5

Description:
------------
I've added a rule to an hidden element of the form. The rule calls a JavaScript function who check the validation.  
When the value of the element is empty, the JS validation function isn't called.
Is there a way to force the calling of this function ?

I can modify the JavaScript generated code by updating the Callback.php file (QuickForm/Rule) but it's not &quot;clean&quot;. Is there an another way ?

Test script:
---------------
Here is my code :

$oSelect =&amp; $oQuickForm-&gt;addElement(&quot;hidden&quot;,&quot;ID_CATEGORIE_LIST&quot;,&quot;&quot;);
$oQuickForm-&gt;registerRule(&quot;checkCategorie&quot;,&quot;callback&quot;,&quot;checkCategorie&quot;);
$oQuickForm-&gt;addRule(&quot;ID_CATEGORIE_LIST&quot;,&quot;bla bla bla&quot;,&quot;checkCategorie&quot;,null,&quot;client&quot;);

Here is the JavaScript generated code :  

value = frm.elements['ID_CATEGORIE_LIST'].value;
if (value != '' &amp;&amp; !checkCategorie(value) &amp;&amp; !errFlag['ID_CATEGORIE_LIST']) {
  errFlag['ID_CATEGORIE_LIST'] = true;
  _qfMsg = _qfMsg + '\n bla bla bla';
}


Expected result:
----------------
The JS validation function should be executed.

Actual result:
--------------
The JavaScript validation function isn't executed because the generated code don't call the JavaScript validation function if the value of the element is empty.</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by gdalle@...
2006-04-20T03:27:14+00:00
PHP: 4.3.10 OS: Win Xp Package Version: 3.2.5

Description:
------------
I've added a rule to an hidden element of the form. The rule calls a JavaScript function who check the validation.  
When the value of the element is empty, the JS validation function isn't called.
Is there a way to force the calling of this function ?

I can modify the JavaScript generated code by updating the Callback.php file (QuickForm/Rule) but it's not &quot;clean&quot;. Is there an another way ?

Test script:
---------------
Here is my code :

$oSelect =&amp; $oQuickForm-&gt;addElement(&quot;hidden&quot;,&quot;ID_CATEGORIE_LIST&quot;,&quot;&quot;);
$oQuickForm-&gt;registerRule(&quot;checkCategorie&quot;,&quot;callback&quot;,&quot;checkCategorie&quot;);
$oQuickForm-&gt;addRule(&quot;ID_CATEGORIE_LIST&quot;,&quot;bla bla bla&quot;,&quot;checkCategorie&quot;,null,&quot;client&quot;);

Here is the JavaScript generated code :  

value = frm.elements['ID_CATEGORIE_LIST'].value;
if (value != '' &amp;&amp; !checkCategorie(value) &amp;&amp; !errFlag['ID_CATEGORIE_LIST']) {
  errFlag['ID_CATEGORIE_LIST'] = true;
  _qfMsg = _qfMsg + '\n bla bla bla';
}


Expected result:
----------------
The JS validation function should be executed.

Actual result:
--------------
The JavaScript validation function isn't executed because the generated code don't call the JavaScript validation function if the value of the element is empty.</pre>]]></description>
      <dc:date>2006-06-18T15:14:55+00:00</dc:date>
      <dc:creator>gdalle &amp;#x61;&amp;#116; cg06 &amp;#x64;&amp;#111;&amp;#x74; fr</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/5957">
      <title>HTML_QuickForm2: Feature/Change Request 5957 [Open] date Element: offer only a range of months</title>
      <link>http://pear.php.net/bugs/5957</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by pav@...
2005-11-14T09:02:32+00:00
PHP: 4.4.1 OS: FreeBSD Package Version: 

Description:
------------
Add the new options to the date Element: minMonth, maxMonth. Works just like minYear and maxYear - it limits the range of months offered in the form to the user.

Test script:
---------------
The patch against CVS head is at

http://raven.oook.cz/date-monthrange.diff</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by pav@...
2005-11-14T09:02:32+00:00
PHP: 4.4.1 OS: FreeBSD Package Version: 

Description:
------------
Add the new options to the date Element: minMonth, maxMonth. Works just like minYear and maxYear - it limits the range of months offered in the form to the user.

Test script:
---------------
The patch against CVS head is at

http://raven.oook.cz/date-monthrange.diff</pre>]]></description>
      <dc:date>2006-06-08T08:53:46+00:00</dc:date>
      <dc:creator>pav &amp;#x61;&amp;#116; FreeBSD &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/5558">
      <title>HTML_QuickForm2: Feature/Change Request 5558 [Analyzed] Use setlocale to determine language</title>
      <link>http://pear.php.net/bugs/5558</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by themars@...
2005-09-29T07:01:42+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
The HTML_QuickForm_Date element ignores the locale set by
    setlocale(LC_TIME, $myLocale);
Why don't you use that locale if the language property is not explicitly set?
If you use the strftime function instead of the date function in the setValue method, you can support it.

Test script:
---------------
Change the default of the language property to &quot;default&quot;:
    line 72
    line 267

Change the line (425):
    $arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value));

into:
    if ($this-&gt;_options['language'] == 'default') {
        $arr = explode('-', strftime('%w-%d-%m-%Y-%I-%H-%M-%S-%p-%p-%V', (int)$value));
        $arr[2] = preg_replace('#^0#', '', $arr[2]);
        $arr[9] = strtoupper($arr[9]);
    } else {
        $arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value));
    }

Expected result:
----------------
if the user does not specify a language, the language specified with setlocale or otherwise the system default language is used. If specified and found, the class behaves as before.

Actual result:
--------------
The language set by setlocale is ignored.</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by themars@...
2005-09-29T07:01:42+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
The HTML_QuickForm_Date element ignores the locale set by
    setlocale(LC_TIME, $myLocale);
Why don't you use that locale if the language property is not explicitly set?
If you use the strftime function instead of the date function in the setValue method, you can support it.

Test script:
---------------
Change the default of the language property to &quot;default&quot;:
    line 72
    line 267

Change the line (425):
    $arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value));

into:
    if ($this-&gt;_options['language'] == 'default') {
        $arr = explode('-', strftime('%w-%d-%m-%Y-%I-%H-%M-%S-%p-%p-%V', (int)$value));
        $arr[2] = preg_replace('#^0#', '', $arr[2]);
        $arr[9] = strtoupper($arr[9]);
    } else {
        $arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value));
    }

Expected result:
----------------
if the user does not specify a language, the language specified with setlocale or otherwise the system default language is used. If specified and found, the class behaves as before.

Actual result:
--------------
The language set by setlocale is ignored.</pre>]]></description>
      <dc:date>2006-06-08T08:25:57+00:00</dc:date>
      <dc:creator>themars &amp;#x61;&amp;#116; users &amp;#x64;&amp;#111;&amp;#x74; sourceforge &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/5308">
      <title>HTML_QuickForm2: Feature/Change Request 5308 [Open] Javascript Validation with Ajax</title>
      <link>http://pear.php.net/bugs/5308</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by xolphin
2005-09-06T04:29:50+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
At the moment HTML_QuickForm uses some Javascript validation if wanted on the OnSubmit of the form. This saves some time checking the form on the server, but it looks nasty. The user has to read the alert created by the JavaScript, and has to find the form element where the error is in. 

Ajax is a development methodology focused on removing click and wait in web applications. I won't explain it here, because there is already a lot of information available on it. 

I think Ajax can be used in HTML_QuickForm very good. With Ajax we could get the folowing advantages:

- Validation code only has to be written ones, and is executed on the server (without the need to submit anything). We don't need a php validation seperate from a javascript validation anymore.
- Code can be checked realtime, while the user is filling in the form. He can instantly see he has done something wrong. Of course this can be made with normal JavaScript too, but Ajax makes it some easier.
- Auto completion can be done with realtime data, instead of auto completion with static data which is already possible now.

A nice example of what can be done with Ajax can be found on http://www.khelder.com/tutorials/smartvalidation/ . For better clarification the form elements with errors can be colored for example yellow or orange. But that is up to the developer.

I hope this is the right place to make such a suggestion, if this is better of in another place, please let me know. I like the Ajax idea a lot and if needed I am willing to code it into HTML_QuickForm. Below some useful links with more info of Ajax.

Validation with Ajax:
http://particletree.com/features/smart-validation-with-ajax

Ajax information: 
http://www.sergiopereira.com/articles/prototype.js.html

How Ajax works:
http://www.adaptivepath.com/publications/essays/archives/000385.php

Ways to implement it:
http://particletree.com/features/a-guide-to-unobtrusive-javascript

Pear implementation:
http://blog.joshuaeichorn.com/HTML_AJAX</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by xolphin
2005-09-06T04:29:50+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
At the moment HTML_QuickForm uses some Javascript validation if wanted on the OnSubmit of the form. This saves some time checking the form on the server, but it looks nasty. The user has to read the alert created by the JavaScript, and has to find the form element where the error is in. 

Ajax is a development methodology focused on removing click and wait in web applications. I won't explain it here, because there is already a lot of information available on it. 

I think Ajax can be used in HTML_QuickForm very good. With Ajax we could get the folowing advantages:

- Validation code only has to be written ones, and is executed on the server (without the need to submit anything). We don't need a php validation seperate from a javascript validation anymore.
- Code can be checked realtime, while the user is filling in the form. He can instantly see he has done something wrong. Of course this can be made with normal JavaScript too, but Ajax makes it some easier.
- Auto completion can be done with realtime data, instead of auto completion with static data which is already possible now.

A nice example of what can be done with Ajax can be found on http://www.khelder.com/tutorials/smartvalidation/ . For better clarification the form elements with errors can be colored for example yellow or orange. But that is up to the developer.

I hope this is the right place to make such a suggestion, if this is better of in another place, please let me know. I like the Ajax idea a lot and if needed I am willing to code it into HTML_QuickForm. Below some useful links with more info of Ajax.

Validation with Ajax:
http://particletree.com/features/smart-validation-with-ajax

Ajax information: 
http://www.sergiopereira.com/articles/prototype.js.html

How Ajax works:
http://www.adaptivepath.com/publications/essays/archives/000385.php

Ways to implement it:
http://particletree.com/features/a-guide-to-unobtrusive-javascript

Pear implementation:
http://blog.joshuaeichorn.com/HTML_AJAX</pre>]]></description>
      <dc:date>2006-06-08T08:24:45+00:00</dc:date>
      <dc:creator>maarten &amp;#x61;&amp;#116; xolphin &amp;#x64;&amp;#111;&amp;#x74; nl</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/4697">
      <title>HTML_QuickForm2: Feature/Change Request 4697 [Open] addRule() - word count</title>
      <link>http://pear.php.net/bugs/4697</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by pioneer@...
2005-06-28T10:25:11+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
I'd like to request a &quot;wordcount&quot; rule for both client and server side processing.  This would be useful for textareas where word counts are critical.</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by pioneer@...
2005-06-28T10:25:11+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
I'd like to request a &quot;wordcount&quot; rule for both client and server side processing.  This would be useful for textareas where word counts are critical.</pre>]]></description>
      <dc:date>2006-06-08T08:21:59+00:00</dc:date>
      <dc:creator>pioneer &amp;#x61;&amp;#116; daweb &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/4268">
      <title>HTML_QuickForm2: Feature/Change Request 4268 [Open] Use of strspn() and strcspn() functions</title>
      <link>http://pear.php.net/bugs/4268</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by jausions
2005-05-03T08:45:28+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
For the lettersonly, alphanumeric and nopunctuation rules, I suggest to use the PHP strspn() and strcspn() function instead of heavy weight regexp.

By the way, is it intentional that not all punctuation characters are in the list of forbidden characters? Missing from the list are: ` &amp; - ;



Reproduce code:
---------------
In HTML_QuickForm_Rule_Regexp

&lt;?php
    function validate($value, $regex = null)
    {
        switch ($this-&gt;name) {
            case 'lettersonly':
            case 'alphanumeric':
            case 'nopunctuation':
                switch ($this-&gt;name) {
                    case 'lettersonly':
                        $str = 'abcdefghijklmnopqrstuvwxyz';
                        $function = 'strspn';
                        break;
                    case 'alphanumeric':
                        $str = 'abcdefghijklmnopqrstuvwxyz0123456789';
                        $function = 'strspn';
                        break;
                    case 'nopunctuation':
                        $str = '().`;\\|/*^?#!@$&amp;%+=-,&quot;\'&gt;&lt;~[]{}';
                        $function = 'strcspn';
                        break;
                }
                return (strlen($value) != $function(strtolower($value, $str))) ? false : true;
                break;
        }
        if (isset($this-&gt;_data[$this-&gt;name])) {
            if (!preg_match($this-&gt;_data[$this-&gt;name], $value)) {
                return false;
            }
        } else {
            if (!preg_match($regex, $value)) {
                return false;
            }
        }
        return true;
    } // end func validate
?&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by jausions
2005-05-03T08:45:28+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
For the lettersonly, alphanumeric and nopunctuation rules, I suggest to use the PHP strspn() and strcspn() function instead of heavy weight regexp.

By the way, is it intentional that not all punctuation characters are in the list of forbidden characters? Missing from the list are: ` &amp; - ;



Reproduce code:
---------------
In HTML_QuickForm_Rule_Regexp

&lt;?php
    function validate($value, $regex = null)
    {
        switch ($this-&gt;name) {
            case 'lettersonly':
            case 'alphanumeric':
            case 'nopunctuation':
                switch ($this-&gt;name) {
                    case 'lettersonly':
                        $str = 'abcdefghijklmnopqrstuvwxyz';
                        $function = 'strspn';
                        break;
                    case 'alphanumeric':
                        $str = 'abcdefghijklmnopqrstuvwxyz0123456789';
                        $function = 'strspn';
                        break;
                    case 'nopunctuation':
                        $str = '().`;\\|/*^?#!@$&amp;%+=-,&quot;\'&gt;&lt;~[]{}';
                        $function = 'strcspn';
                        break;
                }
                return (strlen($value) != $function(strtolower($value, $str))) ? false : true;
                break;
        }
        if (isset($this-&gt;_data[$this-&gt;name])) {
            if (!preg_match($this-&gt;_data[$this-&gt;name], $value)) {
                return false;
            }
        } else {
            if (!preg_match($regex, $value)) {
                return false;
            }
        }
        return true;
    } // end func validate
?&gt;</pre>]]></description>
      <dc:date>2007-07-17T14:34:39+00:00</dc:date>
      <dc:creator>Philippe &amp;#x64;&amp;#111;&amp;#x74; Jausions &amp;#x61;&amp;#116; 11abacus &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/4061">
      <title>HTML_QuickForm2: Feature/Change Request 4061 [Open] Support max/min hours in time controls</title>
      <link>http://pear.php.net/bugs/4061</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by mail@...
2005-04-05T05:52:55+00:00
PHP: 4.3.10 OS: n/a Package Version: 

Description:
------------
It would be helpful to implement something like the maxYear and minYear options for time fields (hours) so the control can be limited to (for example) time in a working day.</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by mail@...
2005-04-05T05:52:55+00:00
PHP: 4.3.10 OS: n/a Package Version: 

Description:
------------
It would be helpful to implement something like the maxYear and minYear options for time fields (hours) so the control can be limited to (for example) time in a working day.</pre>]]></description>
      <dc:date>2006-06-08T08:16:31+00:00</dc:date>
      <dc:creator>mail &amp;#x61;&amp;#116; simonellistonball &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/2535">
      <title>HTML_QuickForm2: Feature/Change Request 2535 [Open] Getting a list of element names and their rules</title>
      <link>http://pear.php.net/bugs/2535</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by strauchdieb@...
2004-10-15T08:51:26+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
I want to retrieve the element names as an array. I wrote a method getElementNames() that returns the keys of $_elementIndex

This is especially useful in addition to the new insertElementBefore function.

Furthermore I want to get a list of rules for each element. For this I wrote the method getElementRules() that returns the $_rules array. 

I made a diff patch with the current stable version of HTML_QuickForm. You can see it at
http://www.gildehaus-hannover.de/QuickForm.diff</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm2 Feature/Change Request
Reported by strauchdieb@...
2004-10-15T08:51:26+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
I want to retrieve the element names as an array. I wrote a method getElementNames() that returns the keys of $_elementIndex

This is especially useful in addition to the new insertElementBefore function.

Furthermore I want to get a list of rules for each element. For this I wrote the method getElementRules() that returns the $_rules array. 

I made a diff patch with the current stable version of HTML_QuickForm. You can see it at
http://www.gildehaus-hannover.de/QuickForm.diff</pre>]]></description>
      <dc:date>2006-06-08T08:16:58+00:00</dc:date>
      <dc:creator>strauchdieb &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>HTML_QuickForm2 Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
