PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #5496

problem with static element in a group

Details

Submitted2005-09-22 14:26 UTC
Fromadgnot at hotmail dot com
StatusNo Feedback
PackageHTML_QuickForm
PHP Version4.3.11
OSLinux
Roadmaps(Not assigned)

Comments

[2005-09-22 14:26 UTC] adgnot at hotmail dot com

Description:
------------
Pear packages :
HTML_COMMON 1.2.1
HTML_QUICKFORM 3.2.5

When I start and finish a group element with a static element, the text of the both is replaced by the value of the checked radio button

Test script:
---------------
// display the radio buttons in a block
$tmp[] = &HTML_QuickForm::createElement( 'static', 'start', '', '<ul>');

// request from the DB
$req = $this->bdd->requete( 'REQUETE', array('select ...' ) );

// loop thru the results
foreach ( $req as $row ) {

$tmp[] = &HTML_QuickForm::createElement( 'static', '', '', '<li>' );
$tmp[] = &HTML_QuickForm::createElement( 'radio', null, null, $row['LIB_FIELD'], $row[$field], 'class="noborder" id="'.$elt_name.'-'.$row[$field].'"' );
$tmp[] = &HTML_QuickForm::createElement( 'static', '', '', '</li>' );

}// end of the loop

$tmp[] = &HTML_QuickForm::createElement( 'static', 'end', '', '</ul>' );

$this->quickform->addGroup( $tmp, 'my_bloc', 'check one radio :' );

Expected result:
----------------
the text param in the static element should stay the same and not be modified :
<ul>
<li><input type="radio" value="1" ...></li>
<li><input type="radio" value="2" ... checked></li>
<li><input type="radio" value="3" ...></li>
</ul>

Actual result:
--------------
I have the value of the checked radio of the group in the text of the static element :

2
<li><input type="radio" value="1" ...></li>
<li><input type="radio" value="2" ... checked></li>
<li><input type="radio" value="1" ...></li>
2