PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject_FormBuilder » Bug #7447

a hideElements method would be great

Details

Request #7447a hideElements method would be great
Submitted2006-04-20 22:40 UTC
Fromrbradford at khov dot com
StatusOpen
PackageDB_DataObject_FormBuilder
PHP Version5.1.1
Roadmaps(Not assigned)

Comments

[2006-04-20 22:40 UTC] rbradford at khov dot com

Description:
------------
It would be really useful to have a method which would turn
included elements into hidden elements. In some of my
forms where I add records I include most of my fields from a
data object, but some of these included fields I don't want
displayed. I know you can use preGenerateForm() and
fb_preDefElements[] to create hidden elements, but a simple
method for this would help a lot.

I'm not totally sure what the method would be (or even if it
is a FormBuilder method), but this is what I was thinking:

$something = DB_DataObject::factory('somethings');
$builder =& DB_DataObject_FormBuilder::create($something);
$elementsToHide = array('user_id', 'created_at'));
$builder->hideElements($elementsToHide);

For example, if this was a form to add a new "something"
then somewhere along the line you could assign values to the
'user_id' and 'created_at' elements but then hide them.
Again, I'm not sure if this method would be in the
FormBuilder or QuickForm classes.

Just a thought.