Populate FormBuilder pulldown based on database?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
garethuk
Forum Members
Forum Members
Posts: 17
Joined: Sat Jun 19, 2010 12:58 pm

Populate FormBuilder pulldown based on database?

Post by garethuk »

Hello everyone,

I have a database which contains a list of values which will change over time. Is there a way to add these values programmatically into a pulldown in a FormBuilder form?

Thanks for any suggestions you guys can offer.
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

Re: Populate FormBuilder pulldown based on database?

Post by brentnl »

I'm looking for the same kind of thing
User avatar
Ricko97
Forum Members
Forum Members
Posts: 65
Joined: Wed Jan 07, 2009 10:14 pm

Re: Populate FormBuilder pulldown based on database?

Post by Ricko97 »

I needed to do something like this last year. You can see the solution I used here: http://forum.cmsmadesimple.org/index.php/topic,33318.msg157499.html#msg157499

Note that you'll have to adjust the UDT to suit, and possibly change the queries to use CMSMS' db object if you're not using MySQL.

EDIT: also, depending on the source of the data, that UDT might be overkill. It was written to retrieve a list of values stored by FormBuilder and display them as options for the dropdown (by inserting them in the DB again along with the relevant field/option IDs). If your data is coming from a table that isn't handled by FormBuilder then the UDT can probably be simplified a bit.
Last edited by Ricko97 on Mon Nov 29, 2010 3:10 pm, edited 1 time in total.
Post Reply

Return to “Modules/Add-Ons”