For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > May 2007 > fb nested forms problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author fb nested forms problem
Leo Márquez

2007-05-30, 8:01 am

Hi,

I'm playing with formbuilder. I need a nested form between this two tables

CENTRALETA
---------------
ID_CENTRALETA (PK)
REF_CENTRALETA (FK)
MODEL
NOM
FOTO


CENTRALETA_IDIOMA
-----------------
REF_CENTRALETA (PK)
CODI_IDIOMA
DESCRIPCIO


links.ini

[CENTRALETA]
REF_CENTRALETA=CENTRALETA_IDIOMA:REF_CEN
TRALETA


The problem I have is that the REF_CENTRALETA field of the
CENTRALETA_IDIOMA table is not filled when I do insert.
The source th generate the form is here:

$do = DB_DataObject::factory('CENTRALETA');
$do->get($_REQUEST['idget']);
$fb = DB_DataObject_FormBuilder::create($do);
$fb->addFormHeader=false;
$fb->createSubmit = false;

$fb->elementNamePrefix = 'frmCentraleta';
$form = $fb->getForm();

$do2 = DB_DataObject::factory('CENTRALETA_IDIOM
A');
$do2->get($do->REF_CENTRALETA);

$fb2 = DB_DataObject_FormBuilder::create($do2);

$fb2->addFormHeader=false;
$fb2->elementNamePrefix = 'frmCentraletaIdioma';
$fb2->useForm($form);
$form = $fb2->getForm();

if ($form->validate()) {
$form->process(array(&$fb, 'processForm'), false);
$form->process(array(&$fb2, 'processForm'), false);
}

echo $form->toHtml();



Any help would be appreciated.
Thank you.

--
Leo Márquez
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com