Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.6.2

Bug #8222 Missing <fieldset>
Submitted: 2006-07-15 00:37 UTC
From: danielmaglione at gmail dot com Assigned: wiesemann
Status: Closed Package: HTML_QuickForm_Renderer_Tableless (version 0.3.0)
PHP Version: 5.1.4 OS: Debian Sarge
Roadmaps: (Not assigned)    
Subscription  


 [2006-07-15 00:37 UTC] danielmaglione at gmail dot com (Daniel Maglione)
Description: ------------ When I create new instance of QuickForm, setting $trackSubmit=true (I need this because I have four forms into a single PHP file), the Tableless renderer misses the <fieldset> open tag, generating an invalid XHTML, like below: <form action="test.php" method="post" id="form"> <input name="_qf__form" type="hidden" value="" /> </fieldset> (...) This needs to be corrected including the open tag (if remove fieldset tag the XHTML doesn't be compliance with XHTML 1.1 specification *), but with fieldset an empty frame will be draw, that it is not desired. My sugestion is to use the inline CSS style "visibility:hidden", like example below: <form action="test.php" method="post" id="form"> <fieldset style="visibility:hidden"> <input name="_qf__form" type="hidden" value="" /> </fieldset> (...) Thanks for your attention. * document type does not allow element "input" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag. (by www.w3c.org). Test script: --------------- $form = new HTML_QuickForm('form', 'post', 'test.php', null, null, true); $form->addElement('text', 'test', 'Test:'); $renderer =& new HTML_QuickForm_Renderer_Tableless(); $form->accept($renderer); echo $renderer->toHtml(); Expected result: ---------------- <form action="test.php" method="post" id="form"> <fieldset style="visibility:hidden"> <input name="_qf__form" type="hidden" value="" /> </fieldset> (...) Actual result: -------------- <form action="test.php" method="post" id="form"> <input name="_qf__form" type="hidden" value="" /> </fieldset> (...)

Comments

 [2006-07-16 19:45 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-07-18 10:51 UTC] danielmaglione at gmail dot com
Dear Mark, First, congratulations for this excelent package and thanks for your attention. 1. Sorry, my program is biggest, and the error really don't occur with this "small" example that I send. I do more tests and this can reproduce the bug: $form1 = new HTML_QuickForm('form1', 'post', 'test.php', null, null, true); $form1->removeAttribute('name'); $form1->addElement('header', null, 'Test'); $form1->addElement('text', 'Test1', 'Test: '); $form2 = new HTML_QuickForm('form2', 'post', 'test.php', null, null, true); $form2->removeAttribute('name'); $form2->addElement('header', null, 'Test'); $form2->addElement('text', 'Test2', 'Test: '); $form3 = new HTML_QuickForm('form3', 'post', 'test.php', null, null, true); $form3->removeAttribute('name'); $form3->addElement('header', null, 'Test'); $form3->addElement('text', 'Test3', 'Test: '); $renderer =& new HTML_QuickForm_Renderer_Tableless(); $form1->accept($renderer); echo ($renderer->toHtml()); $form2->accept($renderer); echo ($renderer->toHtml()); $form3->accept($renderer); echo ($renderer->toHtml()); If helps, I noticed that the error only occurs when: 1. There are 2 or more forms (note in the example above that the error only occur with "form2" and "form3"); 2. The error don't occur when I removed the lines $formX->addElement('header', null, 'Test'); 2. I consider the W3C validator as reference. If you paste the html below, generated (and corrected) by script above, you will see the "container" requirement. I don't check the DTD my self, but if validator says... Test
Test

Test

Test
<br /> </fieldset> </form> </body> </html> Regards, Daniel Maglione
 [2006-07-18 12:41 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-07-18 14:28 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!