views:

54

answers:

1

What's best method within cakephp site for-

  • two dropdowns
  • one listing cds, one listing artists
  • on select of either cd or artist I need my additional text to appear below dropdowns

I have been searching through tutorials and manual - with no success. I am looking to learn by basic example - from form/view and controller.

latest try was something along this example to get dropdown [http://stackoverflow.com/questions/1450457/cakephp-make-select-dropdown]

A: 

Although CakePHP techniques apply, the way that I'd do this in CakePHP is the same way I'd do it in any app. I'd use Javascript (the jQuery framework in my case) to:

  1. Bind an event handler to the change event of each dropdown
  2. Make an Ajax call to a URI that returns the "additional text" to be displayed below the dropdown
  3. Display said text

In the CakePHP context, I'd create methods in my CdsController and ArtistsController (I'm guessing at your naming convention, of course) to respond to the Ajax request.

Rob Wilkerson