Formbuilder and QuickForm - Redirects and Groups
| From: | Justin Patrin | Date: | Sat, 08 Oct 2005 01:28:53 +0000 |
| Subject: | Formbuilder and QuickForm - Redirects and Groups | ||
| References: | 1 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-21275@lists.php.net to get a copy of this message | ||
Hello
I have a couple of which I hope will be easily solved, questions about FB
and QF. I have FB rendering to an array which is then sent to Smarty. Most
of this is working fine
1. How do I redirect the page once the data has been submitted and passed
validation. The error I'm getting is that a header has already been sent.
The only reference to an example of how to fix it in this archive no longer
exists. From Justin Patrin entitled "Re: [PEAR] formbuilder: where do you
put a redirect statement to redirect you to another page after".
"Check my FAQ entry for how to redirect.
> http://opensource.21st.de/tiki-view_faq.php?faqId=1#q4 goes
> nowhere.
2. Would someone please point out to me what I'm doing wrong setting groups
in a script.
** This works:
$el = HTML_QuickForm::createElement('date','pointyearto', 'Point Score
Year Ends', array('format'=> 'dFY'));
$builder->preDefElements['pointyearto'] = $el;
** This doesn't:
// Groups
//
// first set the fields
$bankgroup['bankbsb'] =
HTML_QuickForm::createElement('int','bankbsb', 'Bank BSB');
$bankgroup['bankacctno'] =
HTML_QuickForm::createElement('int','bankacctno', 'Bank Account
Number');
// add them to a group
$group = HTML_QuickForm::addGroup($bankgroup, 'bankgroup', 'Bank
Details', ' ');
// send the group to the form
$builder->preDefElements['bankgroup'] = $group;
The error returned is "Fatal error: Using $this when not in object context
in c:\wamp\www\myproject\include\PEAR\HTML\QuickForm.php on line 725"
Thanks
Prue