PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #2965

updateElementAttr() doesn't work for hierselect

Details

Submitted2004-12-14 16:30 UTC
Fromsebab at info dot com dot pl
Assignedavb
StatusClosed
PackageHTML_QuickForm
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2004-12-14 16:30 UTC] sebab at info dot com dot pl

Description:
------------
QF method updateElementAttr() doesn't work for hierselect - select elements that hierselect consists of don't change their attributes.

HTML_Common 1.2.1
HTML_QuickForm 3.2.4pl1
PEAR 1.3.3.1

Reproduce code:
---------------
$elem=&form->addElement('hierselect', 'myhier', "label", "class='someclass'", "");
$elem->setMainOptions($main);
$elem->setSecOptions($sec);
[...]
$form->updateElementAttr('myhier', "class='otherclass");

Expected result:
----------------
myhier hierselect's constaining two selects with class set to 'otherclass'

Actual result:
--------------
myhier hierselect's constaining two selects with class set to 'someclass'

other example - var_dumped hierselect object (I cut some parts to shorten data) after setting attributes to
array('class'=>'input-disabled','disabled'=>'disabled')
first attributes were set to "class='w115'"

object(HTML_QuickForm_hierselect)[15]
public '_options' =>
array
0 =>
array
'' => ''
3 => 'Audio / Video'
4 => 'CAS'
1 => 'CPU'
1 =>
array
3 =>
array
'' => ''
9 => 'RCA'
10 => 'S-VIDEO'
11 => 'S/PDIF'
8 => 'SCART'
public '_nbElements' => 2
public '_elements' =>
array
0 =>
object(HTML_QuickForm_select)[16]
public '_attributes' =>
array
'class' => 'w115'
'name' => 0
1 =>
object(HTML_QuickForm_select)[17]
public '_attributes' =>
array
'class' => 'w115'
'name' => 1
public '_separator' => ' '
public '_attributes' =>
array
'class' => 'input-disabled'
'disabled' => 'disabled'