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.
Populate FormBuilder pulldown based on database?
Re: Populate FormBuilder pulldown based on database?
I'm looking for the same kind of thing
Re: Populate FormBuilder pulldown based on database?
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.
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.