FormBuilder - cannot create extra buttons
| From: | Prue | Date: | Fri, 04 Nov 2005 22:50:37 +0000 |
| Subject: | FormBuilder - cannot create extra buttons | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-21798@lists.php.net to get a copy of this message | ||
Hello
I am using a combination of QF, FB and Smarty to create my forms. The basic
forms work fine with a couple of tweaks for Smarty, eg the header variable
in the template must be called as {$form.header.0} and the submit button
must be called as {$form.__submit__.html} cos that's just the way it is with
Smarty.
My current problem is that I cannot create any other buttons, in particular
a "reset" button. This my the code:
<snip>
$builder -> createSubmit = 1;
$el = HTML_QuickForm::createElement('reset', 'btnClear', 'Clear');
$builder -> preDefElements['btnClear'] = $el;
</snip>
The FB createSubmit works but the reset button element is ignored. I've
checked the $form array before it's rendered to the Smarty array and there
is no reference to the btnClear element which points to something wrong with
my FB/QF code. If I choose addElement rather than createElement I get the
following QF error:
"Fatal error: Using $this when not in object context in
c:\www\myownproject\include\PEAR\HTML\QuickForm.php on line 602"
Please advise.
Thanks
Prue