Re: HTML_quickForm: Seperating JavaScript from html

From: Date: Wed, 12 Oct 2005 07:53:29 +0000
Subject: Re: HTML_quickForm: Seperating JavaScript from html
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21382@lists.php.net to get a copy of this message
On 12 oct. 05, at 01:21, Mark Steudel wrote:
I am looking for a way to easily separate the javascript from the body of the HTML generated from QuickForm and put it into the head. I am trying to use Smarty to accomplish this. I don't want to have to make a template for all of the forms as I like they way the look just fine. I just went to move the javascript from the body to the head. Thanks, mark
Hi Mark, Here's what I do to remove the javascript from the html generated by quickform : In my php file: $tFormData = $renderer -> toArray(); $Fnm = "js/quickform.js"; $inF = fopen ($Fnm , "w"); fwrite ($inF , $tFormData['javascript']); fclose ($inF); $tpl -> display('mytemplate.tpl'); then of course i add the following line to my template: <SCRIPT type="text/javascript" src="js/quickform.js"></SCRIPT> I don't know if it works for *every* quickform element, though (especially custom quickform element types) but at least it works for me ;-) Also, I don't know if it's the nicest way to do it. What do you think? bye Damien

Attachment: [application/pkcs7-signature] smime.p7s
« previous php.pear.general (#21382) next »