Re: QuickForm - how can I make checkboxes where the vlaue equals something like - NAME=PET_ARRAY[] value=dog> Dog
| From: | l Burnerheimerton | Date: | Tue, 21 Dec 2004 19:32:15 +0000 |
| Subject: | Re: QuickForm - how can I make checkboxes where the vlaue equals something like - NAME=PET_ARRAY[] value=dog> Dog | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16379@lists.php.net to get a copy of this message | ||
I have table1, table 2 and a cross-reference table, table3. Table3 has two fields, table1_ID and
table2_ID.
An exmaple might be, buildings (table1), people (table2), access (table3 listing who has access to
what buildings).
So now that I have this cross-ref table I need to add and edit and delete records. Add was not too
difficult with Quickform.
I am now working on how to edit. There are two parts to editing a table:
1 - displaying the checkboxes with the existing records checked
2 - when the update form is submitted, looping through the checkboxes to see if any of them changed
and updating table3.
I have thought of others way to do this without using a cross-ref table. For example, have an
additional field in table 2 with a delimited list of the table1_IDs. Then have a pull down.
Or I could have multiple listboxes and javascript to move items around and only process one list
box.
I guess what I am looking for is a best practice and how to code it. Maybe using PEAR is not the
best way to handle it - I don't know.
Any help is much appreciated!
Justin Patrin <papercrane@gmail.com> wrote:
On Tue, 21 Dec 2004 05:37:58 -0800 (PST), l Burnerheimerton
wrote:
> I'd like to create checkboxes that render like this:
>
> [input] Dog
> [input] Cat
> [input] Fish
What are you trying? Why is the output you're seeing not what you
want? You need to giv us something to start with here.
I would suggest making the names PET_ARRAY[dog], etc. That way there's
a unique name for each one but you still get them in one array which
you can easily foreach() over.
>
> The best I can come up with so far after MUCH working with it, is where the value = 1. I could
> no tget advcheckbox to work like this either.
>
> Any ideas? Thanks!
>
--
Justin Patrin
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---------------------------------
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.