[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-general
Subject:    Re: [PEAR] DB_dataObject_Formbuilder element types and field display order
From:       "Justin Patrin" <papercrane () gmail ! com>
Date:       2006-02-26 4:39:23
Message-ID: 432beae0602252039v7e2829c1n51865546d2f74b4c () mail ! gmail ! com
[Download RAW message or body]

On 2/25/06, Lloyd Leung <pear@lloydleung.com> wrote:
> Hello,
>
> I'm learning how to use DB_dataObject_Formbuilder and QuickForm.  My
> objective is allow a user to upload a picture, add some descriptions,
> store the metadata and tag it.  I think something like Flickr, but for
> personal local use.
>
> I've successfully used formbuilder to generate a form for me.
>
> However, I still don't know how to accomplish a few things:
>
> - How do I tell a generated form to be certain element type for a given
> field?
>     - i.e. change the default text field to a checkbox or to a
> enumerated type?

If you want booleans (checkbox) then make your field an INT(1)
UNSIGNED. This way DB_DO will see it as a boolean and it will
automatically be a checkbox. If you want to use a text field for a
checkbox (which really makes no sense) then you can use booleanFields.

If you want an enum you can either use a text field and specify the
options or make it an enum in the DB and just tell FB that it is an
enum. (enumFields and enumOptions).

There is full documentation here:
http://opensource.21st.de/16.html
and all of the config options are documented here:
http://opensource.21st.de/23.html

>     - can I do it with Formbuilder, or QuickForm?

Always use FormBuilder if you can. Scour the options, there is a *lot* in here.

>     - if with QuickForm
>         - Do I need to delete the formElement, and re-add it again manually?

If you do use QF you don't need to delete and re-add. Use preDefElements.

>
> - How do I use QuickForm -> insertElementBefore function.  For fields
> that I would not be using with the database.

You just use it. Nothing special, just treat the form as a form (it's
just a QuickForm).

>
> - Is there a way to reorder the fields of a formbuilder generated form?
>

preDefOrder

--
Justin Patrin

-- 
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic