RE: [PEAR] QF - Add an Element to a Form after buildForm
| From: | Daniel Kopp | Date: | Tue, 11 Nov 2003 20:57:46 +0000 |
| Subject: | RE: [PEAR] QF - Add an Element to a Form after buildForm | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8863@lists.php.net to get a copy of this message | ||
Hi!
Should it really be the only possibility to do the following in formBuild:
addElement // -textfield for new value
// -get the new value by $this->exportValue
// -check whether the self-made container-array which
// describes the Checkboxes includes the new choice already
// -if not add the new value to the array that describes the
// group
// -create the group of checkboxes
addElement // -add the group
This does not look nice to me as "validation" would have to be in formbuilt
which mixes up different processes a bit but it works and if nobody knows
something nicer I will do it like that (Besides in this case the only
validation is that there might be an empty value or an existing value).
Comments are welcome!
Daniel
> -----Original Message-----
> From: Daniel Kopp [mailto:pear@daniu.de]
>
>
> I still have the same Problem - only that this time my
> workaround does not work.
>
> I want to have a couple of checkboxes and a "new" field:
>
> Option1 [ ] option2[ ] option3[ ] option4[ ]
> new______
>
> So - after the Form is built I want to add the new field to
> the set of checkboxes. For the template the Buttons should be
> in a group - so that I can just output the whole group. Or is
> there another way to output a "group" of Elements at once
> with ITStatic?
>
> Is there something like Formreset so that I can call
> buildForm again without getting double output? Or is there
> any other way to change the Form after it is built?