RE: [PEAR] Quickform and an array of elements in html
| From: | Mike Carter | Date: | Wed, 04 Jun 2003 08:35:43 +0000 |
| Subject: | RE: [PEAR] Quickform and an array of elements in html | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5775@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Bertrand Mansion [mailto:bmansion@mamasam.com]
> Sent: 03 June 2003 17:59
>
> <mcarter@quantiv.com> wrote :
>
> > Hi,
> >
> > I'm creating a line of buttons (not grouped) using the code:
> >
> > $actions[] = &HTML_QuickForm::createElement('submit', 'action',
> > 'Submit'); $actions[] = &HTML_QuickForm::createElement('submit',
> > 'action', 'Cancel');
> >
> > When I render for form the first time this appears correct.
> >
> > <input name="action_button[action]" value="Submit"
> > type="submit" />
> > <input name="action_button[action]" value="Cancel"
> > type="submit" />
> >
> > However if I submit the form and it then re-displays (due to a
> > validation
> > error) it all goes wrong and I end up with two buttons
> identical in the
> > output html:-
> >
> > <input name="action_button[action]" value="Submit"
> > type="submit" />
> > <input name="action_button[action]" value="Submit"
> > type="submit" />
> >
> > I think this is because the elements 'name' is used as the index in
> > the array - how am I able to get the buttons to appear as
> an array but
> > not step on each others toes? Does the answer lie within the
> > $form->addGroup() method? But why does it work the first time.....?
> >
> > Regards,
>
> Try to upgrade to the last release.
I've been using Beta 2 14/05/2003, I'll check out the new RC from the
28/05/2003 in a moment. The reply from Alexey didn't sound too promising
though :-(
Regards,
Mike C
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.484 / Virus Database: 282 - Release Date: 5/27/2003
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________