<?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_QuickForm_DHTMLRulesTableless</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/15359" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15300" />

     </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/15359">
      <title>HTML_QuickForm_DHTMLRulesTableless: Bug 15359 [Verified] fatal error when appendName is set to false for a group  with a group rule</title>
      <link>http://pear.php.net/bugs/15359</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm_DHTMLRulesTableless Bug
Reported by gery
2008-12-19T23:54:22+00:00
PHP: 5.2.5 OS:  Package Version: 0.3.3

Description:
------------
A php fatal error occurs if the optional parameter &quot;appenName&quot; is set to false in the method HTML_QuickForm::addGroup and a group rule is added to the group. 
 
The fatal error is :

Fatal error: Call to undefined method HTML_QuickForm_Error::getAttribute() in C:\wamp\bin\php\php5.2.5\PEAR\HTML\QuickForm\DHTMLRulesTableless.php on line 248

Test script:
---------------
require_once 'HTML/QuickForm/DHTMLRulesTableless.php';
require_once 'HTML/QuickForm/Renderer/Tableless.php';

$form = new HTML_QuickForm_DHTMLRulesTableless('example');

$id['lastname'] = &amp;HTML_QuickForm::createElement('text', 
                                                 'lastname', 
                                                 'Name', 
                                                 array('size' =&gt; 30));
$id['code']     = &amp;HTML_QuickForm::createElement('text',
                                                 'code', 
                                                 'Code', 
                                                 array('size' =&gt; 5));

$form-&gt;addGroup($id, 'id', 'ID', ',&amp;nbsp', false);

$form-&gt;addGroupRule('id', array(
    'lastname' =&gt; array(
        array('Name is required',    'required', null, 'client')
    )
));

$form-&gt;addElement('submit', null, 'Submit');
$form-&gt;getValidationScript();
$renderer =&amp; new HTML_QuickForm_Renderer_Tableless();
$form-&gt;accept($renderer);
echo $renderer-&gt;toHtml();

Expected result:
----------------
The form is rendered and there is a javascript validation on the first element of the field group. The HTML for the element group should be :

&lt;label class=&quot;element&quot;&gt;ID&lt;/label&gt;&lt;div class=&quot;element&quot;&gt;&lt;input size=&quot;30&quot; name=&quot;lastname&quot; onblur=&quot;validate_example_lastname(this)&quot; onchange=&quot;validate_example_lastname(this)&quot; type=&quot;text&quot;&gt;,&amp;nbsp;&lt;input size=&quot;5&quot; name=&quot;code&quot; type=&quot;text&quot;&gt;&lt;/div&gt;

Actual result:
--------------
The form is not rendered, a fatal error is displayed :

Fatal error: Call to undefined method HTML_QuickForm_Error::getAttribute() in C:\wamp\bin\php\php5.2.5\PEAR\HTML\QuickForm\DHTMLRulesTableless.php on line 248</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm_DHTMLRulesTableless Bug
Reported by gery
2008-12-19T23:54:22+00:00
PHP: 5.2.5 OS:  Package Version: 0.3.3

Description:
------------
A php fatal error occurs if the optional parameter &quot;appenName&quot; is set to false in the method HTML_QuickForm::addGroup and a group rule is added to the group. 
 
The fatal error is :

Fatal error: Call to undefined method HTML_QuickForm_Error::getAttribute() in C:\wamp\bin\php\php5.2.5\PEAR\HTML\QuickForm\DHTMLRulesTableless.php on line 248

Test script:
---------------
require_once 'HTML/QuickForm/DHTMLRulesTableless.php';
require_once 'HTML/QuickForm/Renderer/Tableless.php';

$form = new HTML_QuickForm_DHTMLRulesTableless('example');

$id['lastname'] = &amp;HTML_QuickForm::createElement('text', 
                                                 'lastname', 
                                                 'Name', 
                                                 array('size' =&gt; 30));
$id['code']     = &amp;HTML_QuickForm::createElement('text',
                                                 'code', 
                                                 'Code', 
                                                 array('size' =&gt; 5));

$form-&gt;addGroup($id, 'id', 'ID', ',&amp;nbsp', false);

$form-&gt;addGroupRule('id', array(
    'lastname' =&gt; array(
        array('Name is required',    'required', null, 'client')
    )
));

$form-&gt;addElement('submit', null, 'Submit');
$form-&gt;getValidationScript();
$renderer =&amp; new HTML_QuickForm_Renderer_Tableless();
$form-&gt;accept($renderer);
echo $renderer-&gt;toHtml();

Expected result:
----------------
The form is rendered and there is a javascript validation on the first element of the field group. The HTML for the element group should be :

&lt;label class=&quot;element&quot;&gt;ID&lt;/label&gt;&lt;div class=&quot;element&quot;&gt;&lt;input size=&quot;30&quot; name=&quot;lastname&quot; onblur=&quot;validate_example_lastname(this)&quot; onchange=&quot;validate_example_lastname(this)&quot; type=&quot;text&quot;&gt;,&amp;nbsp;&lt;input size=&quot;5&quot; name=&quot;code&quot; type=&quot;text&quot;&gt;&lt;/div&gt;

Actual result:
--------------
The form is not rendered, a fatal error is displayed :

Fatal error: Call to undefined method HTML_QuickForm_Error::getAttribute() in C:\wamp\bin\php\php5.2.5\PEAR\HTML\QuickForm\DHTMLRulesTableless.php on line 248</pre>]]></description>
      <dc:date>2008-12-26T20:40:07+00:00</dc:date>
      <dc:creator>gery_flament &amp;#x61;&amp;#116; hotmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>HTML_QuickForm_DHTMLRulesTableless Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15300">
      <title>HTML_QuickForm_DHTMLRulesTableless: Bug 15300 [Verified] class &quot;error&quot; not removed on select boxes and textareas</title>
      <link>http://pear.php.net/bugs/15300</link>
      <content:encoded><![CDATA[<pre>HTML_QuickForm_DHTMLRulesTableless Bug
Reported by gery
2008-12-13T22:25:12+00:00
PHP: 5.2.5 OS:  Package Version: 0.3.3

Description:
------------
The style class &quot;error&quot;  set on the field's HTML parent element
when there is an error, is not removed when the user correct the error and leave the field or submit the form. 

This bug affects only select boxes and textareas.

The problem has to do with the line 196
 
of the file \HTML\QuickForm\DHTMLRulesTableless.php:
 
 
if (div.firstChild.innerHTML != &quot;&quot;) {
 
which returns true if you have a select or a textarea as these elements
have or can have some inner HTML.
  
To correct the bug, I'd suggest the rewrite of this line like this :

    if (div.firstChild.tagName == \'DIV\') {

Test script:
---------------
Here a page with a demonstration of the bug:

http://gery.flament.free.fr/en/Development/pear/DHTLM-Rules-class-error-not-removed-with-select.php

Expected result:
----------------
&lt;div class=&quot;element&quot;&gt;
&lt;select id=&quot;animal&quot; name=&quot;animal&quot; onblur=&quot;validate_example_animal(this)&quot;
onchange=&quot;validate_example_animal(this)&quot;&gt;
	&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;Choose&lt;/option
	&lt;option value=&quot;dog&quot;&gt;woof&lt;/option&gt;
	&lt;option value=&quot;cat&quot;&gt;meow&lt;/option&gt;
	&lt;option value=&quot;cow&quot;&gt;moo&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;

Actual result:
--------------
&lt;div class=&quot;element error&quot;&gt;
&lt;select id=&quot;animal&quot; onchange=&quot;validate_example_animal(this)&quot; onblur=&quot;validate_example_animal(this)&quot; name=&quot;animal&quot;&gt;
&lt;option value=&quot;&quot;&gt;Choose&lt;/option&gt;
&lt;option selected=&quot;selected&quot; value=&quot;dog&quot;&gt;woof&lt;/option&gt;
&lt;option value=&quot;cat&quot;&gt;meow&lt;/option&gt;
&lt;option value=&quot;cow&quot;&gt;moo&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;/li&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>HTML_QuickForm_DHTMLRulesTableless Bug
Reported by gery
2008-12-13T22:25:12+00:00
PHP: 5.2.5 OS:  Package Version: 0.3.3

Description:
------------
The style class &quot;error&quot;  set on the field's HTML parent element
when there is an error, is not removed when the user correct the error and leave the field or submit the form. 

This bug affects only select boxes and textareas.

The problem has to do with the line 196
 
of the file \HTML\QuickForm\DHTMLRulesTableless.php:
 
 
if (div.firstChild.innerHTML != &quot;&quot;) {
 
which returns true if you have a select or a textarea as these elements
have or can have some inner HTML.
  
To correct the bug, I'd suggest the rewrite of this line like this :

    if (div.firstChild.tagName == \'DIV\') {

Test script:
---------------
Here a page with a demonstration of the bug:

http://gery.flament.free.fr/en/Development/pear/DHTLM-Rules-class-error-not-removed-with-select.php

Expected result:
----------------
&lt;div class=&quot;element&quot;&gt;
&lt;select id=&quot;animal&quot; name=&quot;animal&quot; onblur=&quot;validate_example_animal(this)&quot;
onchange=&quot;validate_example_animal(this)&quot;&gt;
	&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;Choose&lt;/option
	&lt;option value=&quot;dog&quot;&gt;woof&lt;/option&gt;
	&lt;option value=&quot;cat&quot;&gt;meow&lt;/option&gt;
	&lt;option value=&quot;cow&quot;&gt;moo&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;

Actual result:
--------------
&lt;div class=&quot;element error&quot;&gt;
&lt;select id=&quot;animal&quot; onchange=&quot;validate_example_animal(this)&quot; onblur=&quot;validate_example_animal(this)&quot; name=&quot;animal&quot;&gt;
&lt;option value=&quot;&quot;&gt;Choose&lt;/option&gt;
&lt;option selected=&quot;selected&quot; value=&quot;dog&quot;&gt;woof&lt;/option&gt;
&lt;option value=&quot;cat&quot;&gt;meow&lt;/option&gt;
&lt;option value=&quot;cow&quot;&gt;moo&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;/li&gt;</pre>]]></description>
      <dc:date>2008-12-26T18:58:01+00:00</dc:date>
      <dc:creator>gery_flament &amp;#x61;&amp;#116; hotmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>HTML_QuickForm_DHTMLRulesTableless Bug</dc:subject>
    </item>
</rdf:RDF>
