Re: [Patch] HTML_QuickFrom_Renderer_Defaut generates proper HTML

From: Date: Mon, 15 Aug 2005 17:00:45 +0000
Subject: Re: [Patch] HTML_QuickFrom_Renderer_Defaut generates proper HTML
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-39366@lists.php.net to get a copy of this message
On Monday 15 August 2005 08:45 am, Reinier Kleipool wrote: > Hello Adam and Bertrand, > > I am a happy user of QuickForm but I noticed the Default renderer does > not generate proper HTML (According to HTML_Tidy). It outputs a HTML > fragment but not a full page. At present the JavaScript is just put in > front of the form tag, and the user has no control over its placement. Here > is a patch that changes the default form template and puts the JavaScript > inside the head of the form. It introduces a new placeholder "{validation}" > that sets the place for the validation script. > > I am not completely sure if this is the right way to solve this problem, as > now you cannot insert a form into an existing page. But then again, the > JavaScript should end up in the header and not the body of any page. You > could also add a new attribute of the form that requests a complete HTML > page or a HTML fragment. This attribute could then choose between the two > form templates. One for a fragment, and one for a complete page. > Actually, that's wrong. Script elements can be virtually anywhere on the page, not just in the header. For example, I often have scripts as the last element before I close the body - the scripts can then modify elements on the page without having to fiddle with page-load triggers. But regardless, this is very bad because: - Breaks every single use of QuickForm. - Can't have multiple forms on a page. As far as the JavaScript issue goes, I wrote a <script> element for QuickForm, which included the ability to use inline or external scripts, and generated valid HTML and XHTML markup. It was rejected by the QuickForm maintainers because it required changes to the QF renderer to group the scripts together (much like the special-case for hidden elements). Regardless, you can get it here: http://atomized.org/PEAR/HTML_QuickForm_script-1.1.1.tgz It extends my "simple" QF renderer (generates plain markup for CSS styling; also rejected by the QF devs), so here's that: http://atomized.org/PEAR/HTML_QuickForm_Renderer_Simple-1.0.4.tgz Hope this helps with some of your issues.

Attachment: [application/pgp-signature]
« previous php.pear.dev (#39366) next »