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 #6104

Error in renderer

Details

Submitted2005-11-29 11:02 UTC
Fromjonathanmartens at gmx dot net
StatusBogus
PackageHTML_QuickForm
PHP Version5.0.4
OSWin XP SP2
Roadmaps(Not assigned)

Comments

[2005-11-29 11:02 UTC] jonathanmartens at gmx dot net

Description:
------------
Installation:
- PHP 5.0.4
- PEAR 1.4.5
- WIN XP SP2
- Apache 2.0.54

Renderer seems to drop newline and tab charachters after the END ERROR tag at the end of the Element template.

Test script:
---------------
addElement('text', 'date', TEXT_DATE, null, '');
$form->addElement('select', 'id_device', TEXT_DEVICE, array(0 => TEXT_CHOOSE, 1 => TEXT_OPTION), '');

$form->addElement('reset', 'btnRESET', TEXT_RESET, 'parameters');
$form->addElement('submit', 'btnSubmit', TEXT_SUBMIT, 'parameters');

/*
* template should read like:
*
* {label}
* \n\t\t{element}
* *
* {error}
*
*
*/

$template['element'] = "\n\t{label}\n\t\n\t\t{element}\n\t\t*\n\t\t{error}\n\t\n\n";

$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate($template['element']);

if ($form->validate()) {
$form->freeze();
}

$form->display();

?>

Expected result:
----------------

TEXT_DATE

TEXT_DEVICE


TEXT_CHOOSE
TEXT_OPTION

Actual result:
--------------

TEXT_DATE

TEXT_DEVICE


TEXT_CHOOSE
TEXT_OPTION

</form>

[2005-11-29 11:07 UTC] jonathanmartens at gmx dot net

Oops it seems that the HTML is not rendering very clearly in this bug report:

Expected result:
----------------
<tr>
<tab><td valign="top">TEXT_DEVICE</td>
<tab><tab><td>
<tab><tab><select name="id_device">
<tab><tab><tab><option value="0">TEXT_CHOOSE</option>
<tab><tab><tab><option value="1">TEXT_OPTION</option>
<tab><tab></select>
<tab></td>
</tr>

Actual result:
--------------
<tr>
<tab><td valign="top">TEXT_DEVICE</td>
<tab><td>
<tab><tab><select name="id_device">
<tab><option value="0">TEXT_CHOOSE</option>
<tab><option value="1">TEXT_OPTION</option>
</select></td>
</tr>

[2005-11-29 11:08 UTC] jonathanmartens at gmx dot net

Incorrect e-mailaddress for report (changed)