Populate dropdown in Section Editor

4 posts by 3 authors in: Forums > CMS Builder
Last Post: February 16, 2009   (RSS)

Hi Dave,

Is there a way to populate a dropdown list that is added to a section with the values from another table?

I have several 'class names' sections, each containing several 'class' records, and a 'class dates' section. When the 'manager' is in the 'class dates' section, I'd like the 'manager' to have the ability to first select one of the tables from a dropdown (one of several) and then depending on what table is selected, populate another dropdown with the records from the table selected. This way there would not be any 'double-typing' which may cause a spelling error in the 'class dates' section 'title' which is used to compare titles when displaying the dates available. Make sense? I only see the ability for the admin to add selections now. [unsure]

TIA!

Eric

Re: [ross] Populate dropdown in Section Editor

Thanks, Ross; right there in front of me! A case of "can't see the forest for the tree's", I guess.

Works great for the 'second' step of what I'm trying to do. Is there a way to create a dropdown in the Section Editor that will show a list of all the tables and when the 'manager' selects a table the next dropdown will show the records of that table? I'm guessing I would have to use the 3rd option, "Get options from MYSQL query" to do that (or both) but I'm not sure how that would work.

Any suggestions?

Thanks again for opening my eyes [blush]

Eric

Re: [eduran582] Populate dropdown in Section Editor

By Dave - February 16, 2009

Hi Eric,

Yes, I *think* you could get it doing that. That first step would be to figure out the mysql query to list tablenames.

Keep in mind that if you allow your CMS users to submit MySQL values (such as the tablename) into a MySQL query you'll basically be giving them control to run arbitrary mySql queries. So you'll want to make sure your CMS users are trusted.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com