Re: DB_DataObject_FormBuilder: linked table fields as select boxes

From: Date: Wed, 25 Feb 2004 23:48:26 +0000
Subject: Re: DB_DataObject_FormBuilder: linked table fields as select boxes
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10941@lists.php.net to get a copy of this message
Justin Patrin schrieb:
Suat Imam-Oglu wrote:
Hi all, how do I let FormBuilder show linked table fields as select boxes? In the example from CVS, the form elements for Manufacturer_ID and Category_ID on the products-form should be select boxes, but I get simple text input elements. I've not touched the two ini files (formbuilder.ini and formbuilder.links.ini). Should the select boxes not be autogenerated if the .links.ini exist? Am I missing something? Any help appreciated. PEAR-packages: - DB_DataObject-1.5.3 - HTML_QuickForm-3.2.1 - DB_DataObject_FormBuilder CVS-version (FormBuilder.php,v 1.22 2004/02/09) Thanks Suat
The select boxes are only generated for fields which are set up as links in the db.links.ini file. Check the links.ini section of the DB_DataObject docs. http://pear.php.net/manual/en/package.database.db-dataobject.intro-relations.php
Justin, thanks for your reply. And yes, I know. Actually I have the formbuilder.links.ini file in the correct place ("formbuilder" is the database-name). The fields are set up as links but the select boxes are not generated. Here's the content of the formbuilder.links.ini file (which I didn't change, it's the original files' content as in cvs): --------8<--------- ; This file defines relations between your tables. This is needed for ; automatic combobox building, auto-joins and more. Always keep it up-to-date. ; Format is pretty straightforward: ; [tablename] ; fieldname = targetTableName:targetFieldName [product] manufacturer_ID = manufacturer:manufacturer_id category_ID = category:category_id --------8<--------- Thus, I was wondering if I had missed something. Let me ask the question differently: What exactly do I have to do if I want select boxes for some fields in a form? Is it enough to just set up a db.links.ini file? Will this be enough to get autogenerated select boxes? Need something else? Thanks Suat

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