Code Comments
Programming Forum and web based access to our favorite programming groups.On Fri, 25 Mar 2005 17:43:03 +0100, Andreas Blaafladt <andreas@blaafladt.no> wrote: > * Obsessed <Obsessed@dayofdefeat.be> [2005-03-25 10:52:28]: > > First off, I'm by no means a QuickForm expert. > > You're adding elements with the same names over and over again (email, > btnEdit, btnDelete) in the same HTML_QuickForm instance, and even though > every addElement()-operation results in a new row, it is practically > speaking the same element. And hence, the last setDefaults() sets the > values of the field(s). > > On a slightly related note, last time I did something similar in php, I > added fields suffixed by []'s. > > Eg: <input type="text" name="user[]" value="Joe" /> > > With this, I could access the the values using $_POST['user'][index], > where index would be a number from 0 to n-1 numbers of input-fields. > > However, this approach doesn't seem to be possible in QuickForm. > > Hopefully, someone with more QuickForm-experience will say a few words > about this. :-) > Of course this is possible....but you can't setDefauls correctly on them as they all have the same name. Also, the processing may not work right. It's much better to use an index. -- Justin Patrin
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.