Adding Elements dynamically in HTML_QuickForm_Controller?
| From: | John Stoffel | Date: | Fri, 23 Apr 2004 18:38:27 +0000 |
| Subject: | Adding Elements dynamically in HTML_QuickForm_Controller? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-28302@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to use HTML_QuickForm_Controller to allow end users to edit
records in a Normalized Database. One of the fields that is in a
record can have zero to N (where N maxes out around 50 currently I
think) text fields. I'm using the tabbed.php example as my base to
build on for this set of pages.
I'd like to make it so that the user can just goto the tab in the form
for that data, and start adding these field(s) as needed. The form
would start with just one field.
I assume there would need to be a button the form page to all another
element, using the
$this->addElement('text','field${n}','FieldVal${n}');
But I'm not sure how to implement this. I relize I'd need to setup a
new class, but would I have to reset the variable $this->_formBuilt
to be false when I made the change, so as to force it to visible?
For now, I can deal with just adding elements to the form, I'd just
ignore any empty elements when I did the actually data insert into the
DB.
Can anyone point me to an example which shows me how to make this
work?
Thanks,
John
John Stoffel - Senior Unix Systems Administrator - Lucent Technologies
stoffel@lucent.com - http://www.lucent.com - 978-952-7548