FW: FormBuilder - cannot create extra buttons

From: Date: Sat, 05 Nov 2005 01:51:09 +0000
Subject: FW: FormBuilder - cannot create extra buttons
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21803@lists.php.net to get a copy of this message
Dont worry, I worked it out using the postGenerateForm callback. -----Original Message----- From: Prue [mailto:prue@clipmagic.com.au] Sent: Saturday, 5 November 2005 9:51 AM To: 'pear-general@lists.php.net' Subject: FormBuilder - cannot create extra buttons 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

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