Re: FormBuilder submit button keeping record open?
| From: | Justin Patrin | Date: | Wed, 12 Oct 2005 20:13:54 +0000 |
| Subject: | Re: FormBuilder submit button keeping record open? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21411@lists.php.net to get a copy of this message | ||
On 10/12/05, Wright Zane A A1C 30 IS/DOMM <Zane.Wright@langley.af.mil> wrote:
> Hey all,
>
>
>
> Have a situation here... I am working on migrating to the web from a
> bunch of MS Access forms. I have about everything done but one small
> section. In Access I had originally a "Save" and a "Save and Close"
> button. I am looking to duplicate the Save button, where it saves the
> record and yet still keeps it open for use by the user.
>
>
>
> I have been using the instructions from the PHP Developers Conference
> pdf file and have gotten quite a bit of use out of it. My code I use is
> as follows: (not pasted from code, that is on a different network, so
> please bear with me)
>
>
>
> $table = $_GET['table']; //get the table for auto generation
>
> $do = DB_DataObject::factory($table);
>
> If(isset($_GET['id'])) {
>
> $do->get($_GET['id']); //pull the proper record if its
> already set.
>
> }
>
>
>
> $builder =& DB_DataObject_FormBuilder::create($do);
>
> $form = $builder->getForm($_SERVER['REQUEST_URI']);
>
>
>
> //the problems start here:
>
> If($form->validate()) {
>
> $res = $form->process(array($builder, 'processForm'),
> false);
>
header('Location: '.$_SERVER['REQUEST_URI'].'&id='.$do->id);
Or something similar.
>
> } else {
>
> $form->display();
>
> }
>
>
>
> If anybody can help me out I'd greatly appreciate it! Thanks,
>
>
>
> Zane
>
>
>
--
Justin Patrin