views:

58

answers:

1

Hello- I'm complete noob in Cakephp - here goes...

I have a website set up with Cakephp framework. I would like to create two dropdown forms to compare/show data. When the user selects an item from the dropdown from either one of the forms it is to show the content below on website.

I was thinking this data would need to be stored in an xml file. How do I create and sync two dropdown forms with xml data within Cakephp? The page the form is on is the view(.ctp) file.

Thanks

A: 

You'll probably want to have a look at the online CakePHP docs, particularly on the areas around the Ajax helper - i.e. the observeForm and observeField methods.

I wrote an app a little while ago that needed precisely to vary content around the screen when the user changes dropdowns (however, I didn't use XML though). What I basically did was use the ajax helper to observe the dropdowns and then update the divs which contained the corresponding dropdowns, once a value change has been observed.

With regards to the XML, the topic you will need to look up is "Datasources". However, from your original post, I can't tell whether you mean that XML is a requirement, or just what you foresee as the best solution. You can 'sync' and play about the values inside dropdowns regardless of where the data comes from - it doesn't have to be a static file.

Gaioshin