Pear HTML_QuickForm_Controller
| From: | Daniel Kopp | Date: | Mon, 06 Oct 2003 09:31:02 +0000 |
| Subject: | Pear HTML_QuickForm_Controller | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8286@lists.php.net to get a copy of this message | ||
Hi!
I would like to have a Form were I can Add some fields by clicking a
(submit) Button. Like this:
Form to Enter family data ...
Button: "Add family member"
By clicking the button the form should be echoed again - with entry fields
for one more family member.
But ... How do I get back to the same form?
I had 2 ideas:
a rule:
$this->addElement('submit', 'add','Add User');
$this->addElement('submit', $this->getButtonName('submit'),
'Send');
$this->addRule($this->getButtonName('submit'),
'Bitte Send eingeben', 'required', null 'client');
(to be honest - I don't really know what 'add' or
$this->getButtonName('submit') means or how it has to be but I tried a lot
so I just post it as I think this is not the problem even it might be wrong
here)
Unfortunately this does not work. It does not go back to the Form. It goes
to the handle of "Add User" which was never intended to exist.
The second solution would be to put it in the Form changing code in the
handle of "Add User" but then I don't know how to declare the form as
invalid and go back to it once more as the controller has finished
validation already ...
Any idea?
Thanks!
Daniel
PS.: this is my first post here - hope I did not make any major mistakes