Home » HTML » HTML_QuickForm_Renderer_Tableless » Bug #8277
Extra </fieldset> tag
Details
| Submitted | 2006-07-24 16:17 UTC |
|---|---|
| From | justin dot adie at adieandco dot com |
| Assigned | wiesemann |
| Status | Closed |
| Package | HTML_QuickForm_Renderer_Tableless |
| PHP Version | 5.1.4 |
| OS | Win (but irrelevant) |
| Roadmaps | (Not assigned) |
Comments
[2006-07-24 16:17 UTC] justin dot adie at adieandco dot com
Description:
------------
the renderer adds a broken end fieldset tag at the start of the form, just after the hidden div.
the bug tracker indicates that this was fixed with release 0.3.1.
further the change log for 0.3.1 indicating a fix to bug #8222 doesn't match up to the actual code: for example there is still an invisible div with the qf hidden inputs in it.
the broken renders fine on firefox but not on IE (7 at least) - you get an empty frame.
i believe the issue is in the renderHeader method. I have changed this line
$this->_html .= $this->_closeFieldsetTemplate;
to
if ($this->_fieldsetIsOpen) {
$this->_html .= $this->_closeFieldsetTemplate;
}
which seems to fix it.
Test script:
---------------
require_once "HTML/QuickForm.php";
require_once 'HTML/QuickForm/Renderer/Tableless.php';
$form = new HTML_QuickForm('form1', 'post', $_SERVER['PHP_SELF'],"",NULL,TRUE);
$renderer =& new HTML_QuickForm_Renderer_Tableless();
$form->addElement("header", "", "Foo");
$form->addElement("text", "username", "User Name:");
$form->addElement("header", "", "Bar");
$buttons[] = &HTML_QuickForm::createElement("reset", "reset", "Clear");
$buttons[] = &HTML_QuickForm::createElement("submit", "submit", "Save");
$form->addGroup($buttons, null, null, " ");
$form->accept($renderer);
echo $renderer->toHtml();
Expected result:
----------------
//
Foo
User Name:
Bar
Actual result:
--------------
//NOTE DELETTION OF TRAILING TAG
Foo
User Name:
Bar
<br />
</fieldset>
</form>
[2006-07-24 17:52 UTC] justin dot adie at adieandco dot com
Hi Mark
yes: i'm using 3.2.6 of qf and 0.3.1 of the tableless renderer (although i have changed the line of code i referred to below). No other mods.
the bug report is a copy and paste of the source code sent to the browser.
I confirm that with the latest cvs snapshot (I have just downloaded it - strangely it has not been given a version number), the </fieldset> disappears. However the invisible div is still there. Is this intended?
cheers
Justin
[2006-07-25 13:52 UTC] justin dot adie at adieandco dot com
Hi Mark
thanks for this. all issues closed from my side.
the only alternative i have to the hidden inputs in an invisible div is to put them in the main fieldset. i guess for coding ease i'd put them at the end, just before the close tag. strange requirement of the d2d to require inputs to have a container. isn't that what the form container is for!
cheers
Justin