QuickForm with ITX

From: Date: Sat, 08 Feb 2003 18:20:04 +0000
Subject: QuickForm with ITX
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3672@lists.php.net to get a copy of this message
Hi, I want to use QuickForm together with ITX templates. The submitted data should be displayed on a feedback page after submission. My small test script works fine except the fact that it takes 15 seconds until the feedback page with the submitted data is displayed (tested on WinXP, Apache 1.3.27, PHP 4.2.3). This is too much and I'm looking for the reason. The QuickForm_examples run much faster on the same machine. There is one placeholder called {FORM} in the template and I use $tpl-
setVariable("FORM", $form->toHtml()); to bring the form on the page. Maybe that's why it takes so long?!
Does anybody have a clue on that? Maybe there's a better approach to what I am trying to do?! Thanks for any tip. Joerg Here's my test script (skipped error handling for readability): -- require_once ("HTML/QuickForm.php"); require_once ("HTML/ITX.php"); $tpl = new HTML_Template_ITX("./"); $tpl->loadTemplatefile("form.tpl", true, true); $tpl->setVariable("TITLE", "QuickForm + ITX"); $form = new HTML_QuickForm('test', 'POST'); $form->addElement('text', 'name', 'Name:'); $form->addElement('textarea', 'message', 'Message:'); $form->addRule('name', 'Test Text is a required field', 'required'); $form->addRule('message', 'Test TextArea is a required field', 'required'); $form->addElement('submit', 'submit', 'Submit'); // Tries to validate the form if ($form->validate()) { // remove submit button $form->removeElement('submit', true); // Form is validated, freeze $form->freeze(); } $tpl->setVariable("FORM", $form->toHtml()); // print the output $tpl->show(); --

« previous php.pear.general (#3672) next »