QuickForm reload for editing
| From: | Ed Greenberg | Date: | Fri, 07 Jan 2005 06:09:48 +0000 |
| Subject: | QuickForm reload for editing | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16765@lists.php.net to get a copy of this message | ||
[Sorry if this is a duplicate... I'm not sure the original got out.]
I really appreciate the help I've gotten here, especially from Justin.
So I have my form:
------------
$form = new HTML_QuickForm('frmPost', 'post');
$form->addElement(...);
$form->addElement(...);
$form->addElement(...);
$form->addRule(...);
$form->addRule(...);
$form->addRule(...);
if ($form->validate()) {
// this is where I'm going to process the form on success,
// and it's the focus of my question below
}
$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($t);
$form->accept($renderer);
$t->assign('form_data', $renderer->toArray());
$t->display($current_language.'/post.html');
------------------
While processing a correctly filled out form, I'd like to echo back the submitted info as a frozen form, and then allow the user to select options:
1. actually submit the data for processing
2. go back to the form, with all the data available for editing.
3. abandon the form
1 and 3 are easy. What can I put in there to send myself back around again. It feels like I need to simulate failing validation.
Help?
</edg>