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

Freeze outputs HTML code

Details

Submitted2005-06-26 10:41 UTC
Frommassimo dot vassalli at itti dot it
StatusDuplicate
PackageHTML_QuickForm
PHP Version4.3.10
OSWindows XP
Roadmaps(Not assigned)

Comments

[2005-06-26 10:41 UTC] massimo dot vassalli at itti dot it

Description:
------------
I had a problem showing a freezed element containing the < sign because it was interpreted by the browser as the starting point for a tag and so I was not able to show the field contents when freezed.
I used my own renderer using the element::toHTML function to obtain the output from the single element and I've inserted a control for isFreezed() in which case I change manually the element value to its htmlentities() version.
Maybe it would be useful to output by default in freeze mode the element values preceeded by htmlentities().

[2005-06-26 14:59 UTC] massimo dot vassalli at itti dot it

A very short example, also without freezing:

<?php
require_once 'HTML/QuickForm.php';
require_once ("HTML/QuickForm/Renderer/QuickHtml.php");
$form = new HTML_QuickForm('TheForm','GET');
$renderer =& new HTML_QuickForm_Renderer_QuickHtml();
$ar['name']='Max';
$ar['surname']='Pa<ai';
$form->addElement('select', 'Test_array', '',$ar);
$form->addElement('submit', 'ok', 'OK');
$form->accept($renderer);
$template = $renderer->elementToHtml('FdS_Operazione').$renderer->elementToHtml($this->Selector["id"]).$renderer->elementToHtml('ok');
echo $renderer->toHtml($template);
?>