QuickForm: renderer() not rendering like I want it to
| From: | l Burnerheimerton | Date: | Mon, 15 Aug 2005 19:52:32 +0000 |
| Subject: | QuickForm: renderer() not rendering like I want it to | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20427@lists.php.net to get a copy of this message | ||
I copied the below code from another system that is
working for me and modified it to meet this system's
needs.
What is happening is that the page does render but:
1 - it does not containt a form name/action tag
2 - it does not render with labels and elements
alligned. Rather it looks like it flows them out as
opposed to laying them out as it should.
I have the following code in the quickform page:
<?php
session_start();
require_once("templ.php");
if (!isset($DID)) { //check if edit or new record
$form = new HTML_QuickForm('new_form_USER');
} else {
$form = new HTML_QuickForm('new_form_USER', 'POST',
$_SERVER['PHP_SELF'] . '?' .
$_SERVER['QUERY_STRING']);
}
...
$renderer =& $form->defaultRenderer();
$renderer->setFormTemplate($template);
...
$form->addElement('text', 'fName', 'First Name: ',
array('size'=>'20', 'maxlength'=>'20'));
$form->addElement('text', 'lName', 'Last Name: ',
array('size'=>'20', 'maxlength'=>'20'));
...
if ($form->validate()) {
$form->process('proc_data', false);
header("Location: main.php");
exit;
}
=================================================
The following is from the templ.php required file:
$template = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>title</title>
<link href="styleSHEET.css" rel="stylesheet"
type="text/css">
</head>
<body>
<div id="pWrap">
<div id="header"><img src="header.png"></div>
<div id="navigator">
<ul>
<li><a href="link.php">Browse</a></li>
<li><a href="terms.php">Terms</a></li>
</ul>
</div>
<div id="content">{content}</div>
</div>
</body>
</html>';
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs